Part Number Hot Search : 
6SXB33M CMOZ11V 2SD882 NTE5612 PM5349 FM305 SA120 2N2007
Product Description
Full Text Search
 

To Download TMP92CD23ADFG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  toshiba original cmos 32-bit microcontroller tlcs-900/h1 series tmp92cy23fg tmp92cy23dfg tmp92cd23afg TMP92CD23ADFG semiconductor company
preface thank you very much for making us e of toshiba microcomputer lsis. before use this lsi, refer the se ction, ?notes and restrictions?.
tmp92cy23/cd23a 2009-08-28 92cy23-1 cmos 32-bit microcontrollers tmp92cy23fg/tmp92cy23dfg/t mp92cd23afg/TMP92CD23ADFG 1. outline and device characteristics the tmp92cy23/cd23a are a high-speed advanced 32-bit microcontroller developed for controlling equipment which processes mass data. the tmp92cy23/cd23a has a high-performance cpu (900/h1 cpu) and various built-in i/os. tmp92cy23fg, tmp92cy23fg, tmp92cd23afg and TMP92CD23ADFG are housed in a 100-pin flat package. product name ram rom package lqfp100-p-1414-0.50f tmp92cy23fg tmp92cy23dfg 16k byte 256k byte qfp-p-1420-0.65a lqfp100-p-1414-0.50f tmp92cd23afg TMP92CD23ADFG 32k byte 512k byte qfp-p-1420-0.65a device characteristics are as follows: (1) cpu: 32-bit cpu (900/h1 cpu) ? compatible with 900/l1 instruction code ? 16 mbytes of linear address space ? general-purpose register and register banks ? micro dma: 8 channels (250 ns/4 bytes at f sys = 20 mhz, best case) (2) minimum instruction execution time: 50 ns (at f sys = 20 mhz) (3) external memory expansion ? expandable up to 16 mbytes (shared program/data area) ? can simultaneously support 8- or 16-bit width external data bus ??? dynamic data bus sizing ? separate bus system (4) memory controller ? chip select output: 4 channels (5) 8-bit timers: 6 channels (6) 16-bit timers: 2 channels (7) general-purpose serial interface: 3 channels ? uart/synchronous mode: 3 channels (channel 0 , 1 and 2) ? irda ver.1.0 (115 kbps) mode selectable: 3 channels (channel 0 , 1 and 2) (8) serial bus interface: 2 channels ? i 2 c bus mode ? clock synchronous mode (9) high speed serial interface: 1 channels note: this circuit is not built into tmp92cy23. (10) 10-bit ad converter: 12 channels (11) watchdog timer (12) special timer for clock
tmp92cy23/cd23a 2009-08-28 92cy23-2 (13) key-on wake up (only for halt release):8 channels (14) program patch logic: 8 banks (15) interrupts: tmp92cy23: 50 interrupts, tmp92cd23a: 51 interrupts ? 9 cpu interrupts: software interrupt instruction and illegal instruction ? 32 internal interrupts (tmp92cy23), 33 internal interrupts (tmp92cd23a) : seven selectable priority levels ? 9 external interrupts (int0 to int7 and nmi ): seven selectable priority levels (int0 to int7 selectable edge or level interrupt) (16) input/output ports: 84 pins (17) standby function ? three halt modes: idle2 (programmable), idle1, stop (18) clock controller ? clock doubler (pll) ? clock gear function: select high-frequency clock fc to fc/16 ? special timer for clock (fs = 32.768 khz) (19) operating voltage ? v cc = 3.0 v to 3.6 v (fc max = 40 mhz f osch max = 10mhz(tmp92cd23a)) (20) package ? 100-pin qfp: lqfp100-p-1414-0.50f (tmp92cy23fg/tmp92cd23afg) qfp100-p-1420-0.65a (t mp92cy23dfg/TMP92CD23ADFG)
tmp92cy23/cd23a 2009-08-28 92cy23-3 figure 1.1 tmp92cy23/cd23a block diagram ( ): initial function after reset note: this circuit is not built into tmp92cy23. dvss [4] dvcc [4] x x2 h-osc clock gear pll l-osc avss/vrefl avcc/vrefh port g (pg0)an0/ki0 (pg1)an1/ki1 (pg2)an2/ki2 (pg3)an3/ki3 (pg4)an4/ki4 (pg5)an5/ki5 (pg6)an6/ki6 (pg7)an7/ki7 (pl0)an8 (pl1)an9 (pl2)an10 (pl3)an11/ adtrg port l 10-bit 12ch ad converter key-on wake up (pn0)sck0 (pn1)so0/sda0 (pn2)si0/scl0 (pn3)sck1 (pn4)so1/sda1 (pn5)si1/scl1 port n serial bus i/f (ch.0) serial bus i/f (ch.1) (pf0)txd0 (pf1)rxd0 (pf2)sclk0/ 0cts /clk (pf3)hsso/txd1 (pf4)hssi/rxd1 (pf5)hsclk/sclk1/ 1cts port f serial i/o (ch.0) serial i/o (ch.1) (pd0)tb0out0/int4 (pd1)tb1in0/int5 (pd2)tb1in1/txd2/int6 (pd3)tb1out0/rxd2/int7 (pd4)tb1out1/sclk2/ 2cts port d (pc0)ta0in (pc1)int1 (pc2)int2 (pc3)int3 port c 16-bit timer (tmrb1) 16-bit timer (tmrb0) serial i/o (ch.2) interrupt controller nmi mode controller reset a m0 a m1 special timer for clock watchdog timer (wdt) 32-kb ram 512-kb rom program patch logic 8-banks tlcs-900/h1 cpu ix i y iz sp lh ed cb a w f sr 32bit pc xw a xbc xde xhl xix xiy xiz xsp port 0 d0 to d7 (p00 to p07) port 1 d8 to d15 (p10 to p17) port 4 a 0 to a7 (p40 to p47) port 5 a 8 to a15 (p50 to p57) port 6 a 16 to a23 (p60 to p67) 8-bit timer (tmra5) 8-bit timer (tmra4) 8-bit timer (tmra3) 8-bit timer (tmra2) 8-bit timer (tmra1) 8-bit timer (tmra0) port 8 port 7 0 cs /ta1out (p80) 1 cs /ta3out (p81) 2cs (p82) 3cs / wait /ta5out (p83) xt2 (p77) xt1 (p76) int0 (p74) srlub (p73) srllb (p72) srwr (p71) rd (p70) memory controller (4-blocks) high speed serial i/o (note)
tmp92cy23/cd23a 2009-08-28 92cy23-4 2. pin assignment and functions the assignment of input/output pins for the tmp92cy23/cd23a, their names and functions are as follows: 2.1 pin assignment diagram figure 2.1.1 shows the pin assignment of the tmp92cy23fg/tmp92cd23afg. a vss/vrefl tmp92cy23fg tmp92cd23afg lqfp100 topview 1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 a vcc/vr efh p c1/int1 pc2/in t2 pc3/in t3 pf0/txd0 pf1/rxd0 pf2/sclk0/c ts0/cl k pf3/txd1/hsso pf4/rxd1/hssi pc0/ta0in pf5/sclk1/cts1/hscl k pn0/sck0 pn1/so0/sda0 pn 2/si0/scl0 pn4/so1/sda1 pn 5/si1/scl1 pn3/sck1 pd0/tb0out0/int4 dvss p74/int0 p00/d0 p02/d2 x1 dvs s x2 a m1 pd2/tb1in1/int6/txd2 pd1/tb1in0/int5 p83/cs3/wait/ta5ou t p82/cs2 p81/cs1/ta3ou t p80/cs0/ta1out p67/a23 p66/a22 p65/a21 p64/a20 p63/a19 p62/a18 p61/a17 p60/a16 p57/a15 p56/a14 p55/a13 p54/a12 p53/a11 p52/a10 p51/a9 p50/a8 p 47/a7 p46/a 6 p 45/a5 p44/a4 p43/a3 p42/a 2 p41/a1 p40/a0 dvcc nmi dvss p17/d15 p16/d14 p15/d13 p14/d12 p13 /d11 p12/d1 0 p11/d9 p10/d8 p07/d 7 p06/d6 p05/d 5 p04/d4 p03/d3 p g7 /an7/ki7 p g2/an2/ki2 p l0/an8 pg6/an6/ki 6 p g5/an5/ki5 p g4/an4/ki4 p g3/an3/ki3 pl2/an10 p g1/an1/ki1 pg0/an0/ki0 dvs s p d4/tb1out1/sclk2/cts2 pd3/tb1out0/rxd2/int 7 p73/srl u b p72/srll b p7 1/srwr p70/r d dvc c p76/xt1 p77/xt2 a m0 rese t p01/d1 dvcc pl1 /an9 dvcc pl3/an11/adtrg note: hsso, hssi and hsclk functions are not built into tmp92cy23. figure 2.1.1 pin assignment diagram (100-pin lqfp)
tmp92cy23/cd23a 2009-08-28 92cy23-5 figure 2.1.2 shows the pin assignment of the tmp92cy2 3dfg/TMP92CD23ADFG. tmp92cy23dfg TMP92CD23ADFG qfp100 topview 35 40 45 55 60 65 70 75 p 77/xt2 p g1/ an1 /ki 1 p g0/an0/ki0 a vss/vr ef l a vcc/vrefh p c0/ta0in pc1/int1 p c2/int2 p c3/int3 p f0/txd0 pf1/rxd0 p f2/sclk0/cts0/clk p f3/txd1/hss o p f4/ rxd1/hssi pf5/sclk1/cts1/hsclk pn0 /sck0 p n1/so0/sda0 pn2/si0/scl 0 pn4/so1/sda1 pn5/si1/scl1 pn3/sck1 p d0/tb0out0/int4 dvs s p74/int 0 dvcc p 00/d0 p01/d1 p02/d2 p03/d 3 p04/d 4 p05/d5 p06/d6 p07/d7 p10/d8 p11/d9 p12/d10 p13/d11 p14/d12 p15/d13 p16/d14 p17/d15 dvss nmi dvcc p40/a0 p41 / a1 p42 / a2 p 43 / a3 p44/a4 p45 / a5 p46 / a6 p 47/a7 p 50/a8 p51/a9 p52/a10 p53/a11 p 54/a12 p55/a13 p56/a14 p57/a15 p60/a16 p61/a17 p62/a18 p 63/a19 p 64/a20 p65/a21 p66/a22 p 67/a23 p80/cs0/ta1out p81/cs1/ta3ou t p 82/cs2 p83/cs3/wait/ta5 ou t pd1/tb1in0/int 5 pd2/tb1in1/int6/txd 2 a m1 x2 dvss x1 dvcc reset a m0 p76/xt1 dvcc p70/ r d p71/srw r p72/sr ll b p73/srlub pd3/tb1out0/rxd2/int7 pd4/tb1out1/sclk2/cts2 dvss pl3/an 11/adtrg pl2/an10 pl1/an9 p l0/an8 pg7/an7/ki7 pg6/an6/ki6 pg5/an5/ki5 pg4/an4/ki4 pg3/an3/ki3 pg2/an2/ki2 1 10 5 15 20 25 30 50 80 85 90 95 10 0 note: hsso, hssi and hsclk functions are not built into tmp92cy23. figure 2.1.2 pin assignment diagram (100-pin qfp)
tmp92cy23/cd23a 2009-08-28 92cy23-6 2.2 pin names and functions the following table shows the names and functions of the input/output pins. table 2.2.1 pin names and functions (1/3) pin name number of pin i/o function p00 to p07 d0 to d7 8 i/o i/o port 0: i/o port input or output specifiable in units of bits data: data bus 0 to 7 p10 to p17 d8 to d15 8 i/o i/o port 1: i/o port input or output specifiable in units of bits data: data bus 8 to 15 p40 to p47 a0 to a7 8 i/o output port 4: i/o port input or output specifiable in units of bits address: address bus 0 to 7 p50 to p57 a8 to a15 8 i/o output port 5: i/o port input or output specifiable in units of bits address: address bus 8 to 15 p60 to p67 a16 to a23 8 i/o output port 6: i/o port input or output specifiable in units of bits address: address bus 16 to 23 p70 rd 1 i/o output port 70: i/o port (schmitt input, with pull-up resistor) read: outputs strobe signal for read external memory. p71 srwr 1 i/o output port 71: i/o port (schmitt input, with pull-up resistor) write enable for sram: strobe signal for wiritng data. p72 srllb 1 i/o output port 72: i/o port (schmitt input, with pull-up resistor) data enable for sram on pins d0 to d7 p73 srlub 1 i/o output port 73: i/o port (schmitt input, with pull-up resistor) data enable for sram on pins d8 to d15 p74 int0 1 input input port 74: input port (schmitt input) interrupt request pin 0 : interrupt request pin with programmable level/rising/falling edge p76 xt1 1 i/o input port 76: i/o port (open drain output) low-frequency oscillator connection input pins p77 xt2 1 i/o output port 77: i/o port (open drain output) low-frequency oscillator connection output pins p80 0cs ta1out 1 output output output port 80: output port chip select 0: outputs ?low? when address is within specified address area 8-bit timer 1 output: output pin of 8-bit timer tmra0 or tmra1 p81 1cs ta3out 1 output output output port 81: output port chip select 1: outputs ?low? when address is within specified address area 8-bit timer 3 output: output pin of 8-bit timer tmra2 or tmra3 p82 2cs 1 output output port 82: output port chip select 2: outputs ?low? when address is within specified address area p83 3cs ta5out wait 1 i/o output output input port 83: i/o port (schmitt input) chip select 3: outputs ?low? when address is within specified address area 8-bit timer 5 output: output pin of 8-bit timer tmra4 or tmra5 wait: signal used to request cpu bus wait pc0 ta0in 1 input input port c0: input port (schmitt input) 8-bit timer 0 input: input pin of 8-bit timer tmra0 pc1 int1 1 input input port c1: input port (schmitt input) interrupt request pin 1 : interrupt request pin with programmable level/rising/falling edge pc2 int2 1 input input port c2: input port (schmitt input) interrupt request pin 2 : interrupt request pin with programmable level/rising/falling edge pc3 int3 1 input input port c3: input port (schmitt input) interrupt request pin 3 : interrupt request pin with programmable level/rising/falling edge
tmp92cy23/cd23a 2009-08-28 92cy23-7 table 2.2.2 pin names and functions (2/3) pin name number of pin i/o function pd0 tb0out0 int4 1 i/o output input port d0: i/o port (schmitt input) 16-bit timer 0 output 0: output pin of 16-bit timer tmrb0 interrupt request pin 4 : interrupt request pin with programmable level/rising/falling edge pd1 tb1in0 int5 1 input input input port d1: input port (schmitt input) 16-bit timer 1 input 0: input of count/capture trigger in 16-bit timer tmrb1 interrupt request pin 5 : interrupt request pin with programmable level/rising/falling edge pd2 tb1in1 txd2 int6 1 i/o input output input port d2: i/o port (schmitt input) 16-bit timer 1 input 1: input of count/capture trigger in 16-bit timer tmrb1 serial 2 send data: open drain output programmable interrupt request pin 6 : interrupt request pin with programmable level/rising/falling edge pd3 tb1out0 rxd2 int7 1 i/o output input input port d3: i/o port (schmitt input) 16-bit timer 1 output 0: output pin of 16-bit timer tmrb1 serial 2 receive data interrupt request pin 7 : interrupt request pin with programmable level/rising/falling edge pd4 tb1out1 sclk2 2cts 1 i/o output i/o input port d4: i/o port (schmitt input) 16-bit timer 1 output 1: output pin of 16-bit timer tmrb1 serial 2 clock i/o serial 2 data send enable (clear to send) pf0 txd0 1 i/o output port f0: i/o port (schmitt input) serial 0 send data: open drain output programmable pf1 rxd0 1 i/o input port f1: i/o port (schmitt input) serial 0 receive data pf2 sclk0 0cts clk 1 i/o i/o input output port f2: i/o port (schmitt input) serial 0 clock i/o serial 0 data send enable (clear to send) clock: system clock output pf3 txd1 hsso 1 i/o output output port f3: i/o port (schmitt input) serial 1 send data: open drain output programmable high speed serial send data (note) pf4 rxd1 hssi 1 i/o input input port f4: i/o port (schmitt input) serial 1 receive data high speed serial receive data (note) pf5 sclk1 1cts hsclk 1 i/o i/o input output port f5: i/o port (schmitt input) serial 1 clock i/o serial 1 data send enable (clear to send) high speed serial clock output (note) pg0 to pg7 an0 to an7 ki0 to ki7 8 input port g: input port (schmitt input) analog input 0 to 7: pin used to input to ad conveter key input 0 to 7: pin used for key-on wakeup 0 to 7 pl0 to pl3 an8 to an11 adtrg 4 input port l: input port (schmitt input) analog input 8 to 11: pin used for input to a/d conveter a/d trigger: signal used for request a/d start (shared with pl3) note: hsso, hssi and hsclk functions are not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-8 table 2.2.3 pin names and functions (3/3) pin name number of pin i/o function pn0 sck0 1 i/o i/o port n0: i/o port (schmitt input) serial bus interface 0 clock i/o data at sio mode pn1 so0 sda0 1 i/o output i/o port n1: i/o port (schmitt input, open drain output) serial bus interface 0 send data at sio mode serial bus interface 0 send/receive data at i 2 c mode pn2 si0 scl0 1 i/o input i/o port n2: i/o port (schmitt input, open drain output) serial bus interface 0 receive data at sio mode serial bus interface 0 clock i/o data at i 2 c mode pn3 sck1 1 i/o i/o port n3: i/o port (schmitt input) serial bus interface 1 clock i/o data at sio mode pn4 so1 sda1 1 i/o output i/o port n4: i/o port (schmitt input, open drain output) serial bus interface 1 send data at sio mode serial bus interface 1 send/receive data at i 2 c mode pn5 si1 scl1 1 i/o input i/o port n5: i/o port (schmitt input, open drain output) serial bus interface 1 receive data at sio mode serial bus interface 1 clock i/o data at i 2 c mode nmi 1 input non-maskable interrupt request pin: interrupt request pin with programmable falling edge level or with both edge levels programmable (schmitt input) am0, am1 2 input operation mode: fixed to am1 = ?1? and am0 = ?1? x1 / x2 2 i/o high-frequency oscillator connection i/o pins reset 1 input reset: intializes tmp92cy23/cd23a (s chmitt input, with pull-up resistor) avcc / vrefh 1 input pin used for both power supply pin for ad converter and standard power supply for ad converter (h) avss / vrefl 1 input pin used for both gnd pin for ad converter (0 v) and standard power supply pin for ad converter (l) dvcc 4 ? power supply pins (all dvcc pins should be connected to the power supply pin) dvss 4 ? gnd pins (0 v) (all dvss pins shold be connected to gnd(0v)) 
tmp92cy23/cd23a 2009-08-28 92cy23-9 3. operation this section describes the basic components, functions and operation of the tmp92cy23/ cd23a. 3.1 cpu the tmp92cy23/cd23a contains an advanced high-speed 32-bit cpu (tlcs-900/h1 cpu) 3.1.1 cpu outline the tlcs-900/h1 cpu is a high-speed, high-performance cpu based on the tlcs-900/l1 cpu. the tlcs-900/h1 cpu has an expanded 32-bit internal data bus to process instructions more quickly. the following is an outline of the cpu: table 3.1.1 tmp92cy23/cd23a outline parameter tmp92cy23/cd23a width of cpu address bus 24 bits width of cpu data bus 32 bits internal operating frequency max 20 mhz minimum bus cycle 1-clock access (50 ns at f sys = 20mhz) internal ram 32-bit 1-clock access internal rom 32-bit interleave 2-1-1-1-clock access internal i/o 8-bit 2-clock access external sram, masked rom 8- or 16-bit 2-clock access (waits can be inserted) minimum instruction execution cycle 1-clock (50 ns at f sys =20mhz) conditional jump 2-clock (100 ns at f sys =20mhz) instruction queue buffer 12 bytes instruction set compatible with tlcs-900/l1 (ldx instruction is deleted) cpu mode maximum mode only micro dma 8 channels
tmp92cy23/cd23a 2009-08-28 92cy23-10 3.1.2 reset operation when resetting the tmp92cy23/cd23a, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. then hold the reset input low for at least 20 system clocks (64 s at fc = 10 mhz). at reset, since the clock doubler (pll) is by passed and the clock-gear is set to 1/16, the system clock operates at 312.5 khz (fc = 10 mhz). when the reset has been accepted, the cpu performs the following: ? sets the program counter (pc) as follows in accordance with the reset vector stored at address ffff00h to ffff02h: pc<7:0> data in location ffff00h pc<15:8> data in location ffff01h pc<23:16> data in location ffff02h ? sets the stack pointer (xsp) to 00000000h. ? sets bits of the status register (sr) to 111 (thereby setting the interrupt level mask register to level 7). ? clears bits of the status register to 00 (there by selecting register bank 0). when the reset is released, the cpu starts executing instructions according to the program counter settings. cpu internal regist ers not mentioned above do not change when the reset is released. when the reset is accepted, the cpu sets internal i/o, ports and ot her pins as follows. ? initializes the internal i/o registers. ? sets the port pins, including the pins that also act as internal i/o, to general-purpose input or output port mode. a reset input terminal becomes ?high?, if reset release is carried out, a built-in flashrom warm-up circuit (notes) will start operation, and internal reset will be canceled after the end of the circuit of operation. memory controller operation cannot be ensured until the power supply becomes stable after power-on reset. external ram data provided before turning on the tmp92cy23/cd23a may be corrupted because the control signals are unstable until the power supply beco mes stable after power-on reset. note: although this product is a maskrom product, in order to consider as the same operation as a flashrom product, built-in flashrom warm-up ti me enters. the warm-up time of build-in flashrom into becomes it as follows. at f osch = 10 mhz 409.6 s (2 12 / f osch )
tmp92cy23/cd23a 2009-08-28 92cy23-11 figure 3.1.1 shows the example of operating the reset timing of tmp92cy23/cd23a. figure 3.1.1 powe r on re set timing example 3.1.3 setting of am0 and am1 set am1 and am0 pins as shown in table 3.1.2 according to system usage. table 3.1.2 operation mod e setup table mode setup input pin operation mode reset am1 am0 internal rom starting 1 1 high-frequency oscillation stabilized time + 20 system clock 0 s (min) vcc (3.3 v) reset
tmp92cy23/cd23a 2009-08-28 92cy23-12 3.2 memory map figure 3.2.2 show the memory maps of the tmp92cy23, and figure 3.2.2 show the memory maps of the tmp92cd23a respectively. figure 3.2.1 tmp92cy23 memory map external memory external memory internal i/o (8 kbytes) internal ram (16 kbytes) direct area (n) 64-kbytes area (nn) 16-mbytes area (r) ( ?r) (r +) (r + r8/16) (r + d8/16) (nnn) 000000h 000100h 002000h 006000h f00000h f10000h ffff00h ffffffh ( = internal area) provisional emulator control (64 kbytes) 010000h (note 1) (note 2) vector table (256 bytes) internal rom (256 kbytes) fc0000h
tmp92cy23/cd23a 2009-08-28 92cy23-13 figure 3.2.2 tmp92cd23a memory map note 1: the provisional emulator control area, mapped f00000h to f0ffffh after reset, is for emulator use and so is not availab le. when emulator srwr signal and rd signal are asserted, this area is access ed. ensure external memory is used. note 2: do not use the last 16-byte area (fffff0h to ffffffh). this area is reserved for an emulator. external memory external memory internal i/o (8 kbytes) internal ram (32 kbytes) direct area (n) 64-kbytes area (nn) 16-mbytes area (r) ( ?r) (r +) (r + r8/16) (r + d8/16) (nnn) 000000h 000100h 002000h 00a000h f00000h f10000h ffff00h ffffffh ( = internal area) provisional emulator control (64 kbytes) 010000h (note 1) (note 2) vector table (256 bytes) internal rom (512 kbytes) f80000h
tmp92cy23/cd23a 2009-08-28 92cy23-14 3.3 clock function and stand-by function the tmp92cy23/cd23a contains (1) clock ge ar, (2) clock doubler (pll), (3) stand-by controller and (4) noise reduction circuits. they are used for low power, low noise systems. this chapter is organized as follows: 3.3.1 block diagram of system clock 3.3.2 sfr 3.3.3 system clock controller 3.3.4 clock doubler (pll) 3.3.5 noise reduction circuits 3.3.6 stand-by controller
tmp92cy23/cd23a 2009-08-28 92cy23-15 the clock operating modes are as follows: (a) single clock mode (x1, x2 pins only), (b) dual clock mode (x1, x2, xt1 and xt2 pins) and (c) tr iple clock mode (x1, x2, xt1 and xt2 pins and pll). figure 3.3.1 shows a transition figure. reset (f osch /32) release reset instruction interrupt stop mode (stops all circuits) normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) (a) single clock mode transition figure (b) dual clock mode transition figure slow mode (fs/2) reset (f osch /32) release reset normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) idle2 mode (i/o operate) idle1 mode (operate only oscillator) instruction instruction interrupt interrupt instruction instruction interrupt interrupt instruction instruction interrupt interrupt instruction interrupt stop mode (stops all circuits) instruction interrupt stop mode (stops all circuits) using pll note reset (f osch /32) release reset normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) stop mode (stops all circuits) slow mode (fs/2) normal mode (4 f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate oscillator and pll) idle2 mode (i/o operate) idle1 mode (operate only oscillator) (c) triple clock mode transition figure instruction instruction interrupt interrupt instruction instruction instruction interrupt note instruction instruction interrupt instruction instruction interrupt interrupt interrupt interrupt instruction instruction instruction interrupt note 1: it is not possible to control pll in slow mode when shifting from slow mode to normal mode with use of pll. (pll start up/stop/change write to pllcr0, pllcr1 register) note 2: when shifting from normal mode with use of pll to normal mode, execute the following setting in the same order. 1) change cpu clock (pllcr0 ?0?) 2) stop pll circuit (pllcr1 ?0?) note 3: it is not possible to shift from normal mode with use of pll to stop mode directly. normal mode should be set once before shifting to stop mode. (stop the high-frequency oscillator after stopping pll.) figure 3.3.1 system clock block diagram the clock frequency input from th e x1 and x2 pins is called f osch and the clock frequency input from the xt1 and xt2 pins is called fs. the clock frequency selected by syscr1 is called the clock f fph . the system clock f sys is defined as the divided clock of f fph , and one cycle of f sys is defined as one state.
tmp92cy23/cd23a 2009-08-28 92cy23-16 3.3.1 block diagram of system clock tmra0 to 5,tmr b0 t o 1 f sys cpu rom interrupt controller ram ad c prescaler t0 sio0 to sio2 special timer for clock f s prescaler i/o ports c lock-gear syscr1 selector fs f osch low-frequency oscillator xt1 xt2 syscr0 warm-up timer (h igh/low-frequency oscillator) sy scr 0 sy scr 2 x1 x2 clock doubler (pll) f pl l = f osch 4 2 16 4 fc/ 1 6 fc/8 fc/4 fc/2 f c pl lcr0 syscr1 2 4 f fph f sys 2 t0 fs t s ys cr0 high-frequency oscillator 8 lock up timer (pll) pllcr1, pllcr0 wdt sbi0 to sbi1 prescaler t hsc (note) note: this circuit is not built into tmp92cy23. figure 3.3.2 block diag ram of system clock frequency of external oscillator is 6 to 10mhz. don?t connect oscillator more than 10mhz. (tmp92cd23a only)
tmp92cy23/cd23a 2009-08-28 92cy23-17 3.3.2 sfr 7 6 5 4 3 2 1 0 bit symbol xen xten wuef read/write r/w r/w reset state 1 0 0 function high- frequency oscillator (f osch ) 0: stop 1: oscillation low- frequency oscillator (fs) 0: stop 1: oscillation warm-up timer 0: write don?t care 1: write start timer 0: read end warm-up 1: read do not end warm-up 7 6 5 4 3 2 1 0 bit symbol sysck gear2 gear1 gear0 read/write r / w reset state 0 1 0 0 function select system clock 0: fc 1: fs select gear value of high-frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: reserved 110: reserved 111: reserved 7 6 5 4 3 2 1 0 bit symbol ? wuptm1 wuptm0 haltm1 haltm0 drve read/write r/w r/w r/w reset state 0 1 0 1 1 0 function always write ?0? warm-up timer 00: reserved 01: 2 8 /input frequency 10: 2 14 /input frequency 11: 2 16 /input frequency halt mode 00: reserved 01: stop mode 10: idle1 mode 11: idle2 mode 1: the inside of stop mode also drives a pin note 1: the unassigned registers, syscr0, syscr0, syscr1, and syscr2 are read as undefined value. note 2: low-frequency oscillator is enabled on reset. figure 3.3.3 sfr for system clock syscr0 (10e0h) syscr1 (10e1h) syscr2 (10e2h)
tmp92cy23/cd23a 2009-08-28 92cy23-18 7 6 5 4 3 2 1 0 bit symbol protect extin(note) ? drvoscl read/write r r/w reset state 0 0 1 1 emccr0 (10e3h) function protect flag 0: off 1: on 1: external clock always write ?1? fs oscillator driver ability 1: normal 0: weak note: this register is a register for tmp92cy23. there is no in tmp92cd23a. please refer to the following for the register for tmp92cd23a. 7 6 5 4 3 2 1 0 bit symbol protect ? ? drvoscl read/write r r/w reset state 0 0 1 1 function protect flag 0: off 1: on always write ?0? always write ?1? fs oscillator driver ability 1: normal 0: weak note: this register is a register for tmp92cd23a. note1: when restarting the oscillator from the stop oscillation state (e.g. restar ting the oscillator in stop mode), set emccr0 = ?1?. note2: do not write emccr0 = ?1? when using external resonator. 7 6 5 4 3 2 1 0 bit symbol read/write reset state function bit symbol read/write reset state function switch the protect on/off by writing the following to 1st-key, 2nd-key 1st-key: write in sequence emccr1 = 5ah, emccr2 = a5h 2nd-key: write in sequence emccr1 = a5h, emccr2 = 5ah figure 3.3.4 sfr for system clock emccr0 (10e3h) emccr1 (10e4h) emccr2 (10e5h)
tmp92cy23/cd23a 2009-08-28 92cy23-19 7 6 5 4 3 2 1 0 bit symbol fcsel lupfg read/write r/w r reset state 0 0 function select fc clock 0: f osch 1: f pll lock up timer status flag 0: not end 1: end note: ensure that the logic of pllcr0 is different from 900/l1?s dfm. 7 6 5 4 3 2 1 0 bit symbol pllon read/write r / w reset state 0 function control on/off 0: off 1: on figure 3.3.5 sfr for pll pllcr0 (10e8h) pllcr1 (10e9h)
tmp92cy23/cd23a 2009-08-28 92cy23-20 3.3.3 system clock controller the system clock controller gene rates the system clock signal (f sys ) for the cpu core and internal i/o. it contains two oscillation circu its and a clock gear circuit for high-frequency (fc) operation. the register syscr1 changes the system clock to either fc or fs, syscr0 and syscr0 control enab ling and disabling of each oscillator, and syscr1 sets the high-frequency clock gear to either 1, 2, 4, 8 or 16 (fc, fc/2, fc/4, fc/8 or fc/16). these functions can reduce the power consumption of the equipment in which the device is installed. the combination of settings = ?1?, = ?0? and = ?100? will cause the system clock (f sys ) to be set to fc/32 (fc/16 1/2) after reset. for example, f sys is set to 0.3125 mhz when the 10 mhz oscillator is connected to the x1 and x2 pins. (1) switching from normal mode to slow mode when the resonator is connected to the x1 and x2 pins, or to the xt1 and xt2 pins, the warm-up timer can be used to change the operation frequency after stable oscillation has been attained. the warm-up time can be sele cted using syscr2. this warm-up timer can be programmed to start and stop as shown in the following examples 1 and 2. table 3.3.1 shows the warm-up time. note 1: when using an oscillator (othe r than a resonator) with stable oscillation, a warm-up timer is not needed. note 2: the warm-up timer is operated by an oscillation clo ck. hence, there may be some variation in warm-up time. table 3.3.1 warm-up times at f osch = 10 mhz, fs = 32.768 khz warm-up time syscr2 change to normal mode change to slow mode 01 (2 8 /frequency) 25.6 ( s) 7.8 (ms) 10 (2 14 /frequency) 1.638 (ms) 500 (ms) 11 (2 16 /frequency) 6.554 (ms) 2000 (ms)
tmp92cy23/cd23a 2009-08-28 92cy23-21 example 1: setting the clock changing from high-frequency (fc) to low-frequency (fs). syscr0 equ 10e0h syscr1 equ 10e1h syscr2 equ 10e2h ld (syscr2), 0 x 1 1 ? ? x ? b ; sets warm-up time to 2 16 /fs. set 6, (syscr0) ; enables low-frequency oscillation. set 2, (syscr0) ; clears and starts warm-up timer. wup: bit 2, (syscr0) ; jr nz, wup ; detects stopping of warm-up timer. set 3, (syscr1) ; changes f sys from fc to fs. res 7, (syscr0) ; disables high-frequency oscillation. x: don?t care, ?: no change enables low-frequency clears and starts warm-up timer chages f sys from fc to fs end of warm-up timer disabiles high-frequency fc x1, x2 pins xt1, xt2 pins warm-up timer system clock f sys end of warm-up timer fs counts up by f sys counts up by fs
tmp92cy23/cd23a 2009-08-28 92cy23-22 example 2: setting the clock changing from low-frequency (fs) to high-frequency (fc). syscr0 equ 10e0h syscr1 equ 10e1h syscr2 equ 10e2h ld (syscr2), 0 x 1 0 ? ? x ? b ; sets warm-up time to 2 14 /fc. set 7, (syscr0) ; enables high-frequency oscillation. set 2, (syscr0) ; clears and starts warm-up timer. wup: bit 2, (syscr0) ; jr nz, wup ; detects stopping of warm-up timer. res 3, (syscr1) ; changes f sys from fs to fc. res 6, (syscr0) ; disables low-frequency oscillation. x: don?t care, ?: no change counts up by f sys counts up by fc disables low-frequency enables high-frequency clears and starts warm-up time r changes f sys from fs to fc end of warm-up time r x1, x2 pins xt1, xt2 pins warm-up timer system clock f sys end of warm-up timer fc fs
tmp92cy23/cd23a 2009-08-28 92cy23-23 (2) clock gear controller f fph is set according to the contents of the clock gear select register syscr1 to either fc, fc /2, fc/4, fc/8 or fc/16. using the clock gear to select a lower value of f fph reduces power consumption. example 3: changing to a high-frequency gear syscr1 equ 10e1h ld (syscr1), xxxx0001b ; changes f sys to fc/2. x: don?t care (high-speed clock gear changing) to change the clock gear, write the register value to the syscr1 register.it is necessary for the warm-up time to elapse before the change occurs after writing the register value. there is the possibility that the instruction following the clock gear changing instruction is executed by the clock gear before changing.to execute the instruction following the clock gear switching instructio n by the clock gear after changing, input the dummy instruction as follows (instruction to execute the write cycle). example: syscr1 equ 10e1h ld (syscr1), xxxx0010b ; changes f sys to fc/4. ld (dummy), 00h ; dummy instruction instruction to be executed after clock gear has changed
tmp92cy23/cd23a 2009-08-28 92cy23-24 3.3.4 clock doubler (pll) pll outputs the f pll clock signal, which is four times as fast as f osch . a low-speed-frequency oscillator can be used, even though the internal clock is high-frequency. a reset initializes pll to stop status, so setting to pllcr0, pllcr1 register is needed before use. as with an oscillator, this circuit requires time to stabilize. this is called the lock up time and it is measured by a 16-stage binary counter. lock up time is about 1.6 ms at f osch = 10 mhz. note 1: input frequency range for pll the input frequency range (high-frequency oscillation) for pll is as follows: f osch = 6 to 10 mhz (v cc = 3.0 to 3.6 v) note 2: pllcr0 the logic of pllcr0 is different from 900/l1?s dfm. exercise care in determining the end of lock up time. the following is an example of settings for pll starting and pll stopping. example 1: pll starting pllcr0 equ 10e8h pllcr1 equ 10e9h ld (pllcr1), 1 x x x x xx x b ; enables pll operation and starts lock up . lup: bit 5, (pllcr0) ; jr z, lup ; detects end of lock up. ld (pllcr0), x 1 x x x xx x b ; changes fc from 10 mhz to 40 mhz. x: don?t care counts up by f osch changes from 10 mhz to 40 mhz starts pll operation and starts lock up pll output: f pll lock up timer system clock f sys a fter lock u p during lock up lock up ends
tmp92cy23/cd23a 2009-08-28 92cy23-25 example 2: pll stopping pllcr0 equ 10e8h pllcr1 equ 10e9h ld (pllcr0), x0xxxxxxb ; changes fc from 40 mhz to10 mhz. ld (pllcr1), 0xxxxxxxb ; stop pll. x: don?t care changes from 40 mhz to 10 mhz pll output: f pll system clock f sys stops pll operation
tmp92cy23/cd23a 2009-08-28 92cy23-26 limitations on the use of pll 1. it is not possible to execute pll enable/disable control in the slow mode (fs) (writing to pllcr0 and pllcr1). pll should be controlled in the normal mode. 2. when stopping pll operation during pll use, execute the following settings in the same order. ld (pllcr0), 00h ; change the clock f pll to f osch ld (pllcr1), 00h ; pll stop 3. when stopping the high-frequency oscillator during pll use, stop pll before stopping the high-frequency oscillator. examples of settings are shown below: (1) start up/change control (ok) low-frequency oscillator operation mode (fs) (high-frequency oscillator stop) high-frequency oscillator start up high-frequency oscillator operation mode (f osch ) pll start up pll use mode (f pll ) ld (syscr0), 1 1 ? ? ? 1 ? ? b ; high-frequency oscillator start/warm-up start wup: bit 2, (syscr0) ; jr nz, wup ; check for warm-up end flag ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f osch ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the system clock f osch to f pll (ok) low-frequency oscillator operation mode (fs) (high-frequency oscillator operate) high-frequency oscillator operation mode (f osch ) pll start up pll use mode (f pll ) ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f osch ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the system clock f osch to f pll (error) low-frequency oscillator operation mode (fs) (high-frequency oscillator stop) high-frequency oscillator start up pll start up pll use mode (f pll ) ld (syscr0), 1 1 ? ? ? 1 ? ? b ; high-frequency oscillator start/warm-up start wup: bit 2, (syscr0) ; jr nz, wup ; check for warm-up end flag ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the internal clock f osch to f pll ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f pll
tmp92cy23/cd23a 2009-08-28 92cy23-27 (2) change/stop control (ok) pll use mode (f pll ) high-frequency oscillator operation mode (f osch ) pll stop low-frequency oscillator operation mode (fs) high-frequency oscillator stop ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the system clock f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop ld (syscr1), ? ? ? ? 1 ? ? ? b ; change the system clock f osch to fs ld (syscr0), 0 ? ? ? ? ? ? ? b ; high-frequency oscillator stop (error) pll use mode (f pll ) low-frequency oscillator operation mode (fs) pll stop high-frequency oscillator stop ld (syscr1), ? ? ? ? 1 ? ? ? b ; change the system clock f pll to fs ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the internal clock (f c ) f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop ld (syscr0), 0 ? ? ? ? ? ? ? b ; high-frequency oscillator stop (ok) pll use mode (f pll ) set the stop mode high-frequency oscillator operation mode (f osch ) pll stop halt (high-frequency oscillator stop) ld (syscr2), ? ? ? ? 01 ? ? b ; set the stop mode (this command can be executed before use of pll) ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the system clock f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop halt ; shift to stop mode ( error) pll use mode (f pll ) set the stop mode halt (high-frequency oscillator stop) ld (syscr2), ? ? ? ? 01 ? ? b ; set the stop mode (this command can execute before use of pll) halt ; shift to stop mode
tmp92cy23/cd23a 2009-08-28 92cy23-28 3.3.5 noise reduction circuits noise reduction circuits are built-in, allowing implementation of the following features. (1) reduced drivability for low-frequency oscillator (2) reduced drivability for low-frequency oscillator (note) (3) sfr protection of register contents note: this function can use only tmp92cy23. these functions need a setup by emccr0, emccr1, and emccr2 register. (1) reduced drivability for low-frequency oscillator (purpose) reduces noise and power for oscillator when a resonator is used. (block diagram) (setting method) the drive ability of the oscillator is reduced by writing ?0? to the emccr0 register. at reset, is initialized to ?1? and the oscillator starts oscillation by normal drivability when the power-supply is on. f s enable oscillation emccr0 xt1 pin xt2 pin c1 c2 resonator
tmp92cy23/cd23a 2009-08-28 92cy23-29 (2) single drive for high-frequency oscillator (note) (purpose) remove the need for twin drives and prevent operational errors caused by noise input to x2 pin when an external oscillator is used . note: this function can use only tmp92cy23. (block diagram) ( setting method) the oscillator is disabled and starts operation as buffer by writing ?1? to emccr0 register. x2 pi n?s output is always ?1?. at reset, is initialized to ?0?. note: do not write emccr0 = ?1? when using external resonator. f osch enable oscillation emccr0 x1 pin x2 pin
tmp92cy23/cd23a 2009-08-28 92cy23-30 (2) runaway prevention using sfr protection register (purpose) prevention of program runaway caused by introduction of noise. write operations to a specified sfr are prohibited so that the program is protected from runaway caused by stopping of the clock or by changes to the memory control register (memory controller) which prevent fetch operations. runaway error handling is also facilitated by intp0 interruption. specified sfr list 1. memory controller b0csl/h, b1csl/h, b2csl/h, b3csl/h, bexcsl/h msar0, msar1, msar2, msar3, mamr0, mamr1, mamr2, mamr3, pmemcr 2. clock gear syscr0, syscr1, syscr2, emccr0 4. pll pllcr0, pllcr1 (operation explanation) execute and release of protection (write operation to specified sfr) becomes possible by setting up a double key to emccr1 and emccr2 registers. (double key) 1st key: writes in sequence, 5ah at emccr1 and a5h at emccr2 2nd key: writes in sequence, a5h at emccr1 and 5ah at emccr2 protection state can be confirmed by reading emccr0. at reset, protection becomes off. intp0 interruption also occurs when a write operation to the specified sfr is executed with protection in the on state.
tmp92cy23/cd23a 2009-08-28 92cy23-31 3.3.6 stand-by controller (1) halt modes and port drive register when the halt instruction is executed, the operating mode switches to idle2, idle1 or stop mode, depending on the contents of the syscr2 register. the subsequent actions performed in each mode are as follows: 1. idle2: only the cpu halts. the internal i/o is available to select operation during idle2 mode by setting the following register. table 3.3.2 shows the register se ttin g op eration during idle2 mode . table 3.3.2 sfr setting operation during idle2 mode internal i/o sfr tmra01 ta01run tmra23 ta23run tmra45 ta45run tmrb0 tb0run tmrb1 tb1run sio0 sc0mod1 sio1 sc1mod1 sio2 sc2mod1 ad converter admod1 wdt wdmod sbi0 sbi0br0 sbi1 sbi1br0 2. idle1: only the oscillator and the special timer for clock continue to operate. 3. stop: all internal circuits stop operating. the operation of each of the different halt modes is described in table 3.3.3. table 3.3.3 i/o oper ation during halt modes halt mode idle2 idle1 stop syscr2 11 10 01 cpu stop i/o ports the state at the time of "halt" instruction execution is held. table 3.3.7 and table 3.3.8 references tmra, tmrb sio, sbi ad converter wdt available to select operation block interrupt controller stop hsc (note) block special timer for clock operate operate note: this circuit is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-32 (2) how to release the halt mode these halt states can be released by resetting or requesting an interrupt. the halt release sources are determined by the combination of the states of the interrupt mask register and the halt modes. the details for releasing the halt status are shown in table 3.3.4. release by in terrupt requestin g the halt mode release method depends on the status of the enabled interrupt .when the interrupt request level set before executing the halt instruction exceeds the value of the interrupt mask register, the interrupt is processed depending on its status after the halt mode is released, and the cpu status executing the instruction that follows the halt instruction. when the interrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, halt mode release is not executed. (in non-maskable interrupts, interrupt proces sing is processed after releasing the halt mode regardless of the value of the mask register.) however only for int0 to int7, intrtc interrupts, even if the inte rrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, halt mode release is executed. in this case, the interrupt is processed, and the cpu starts executing the instruction following the halt instruction, but the interrupt request flag is held at ?1?. release by resetting release of all halt statuses is executed by resetting. when the stop mode is released by reset, it is necessary to allow enough resetting time (see table 3.3.5) for operation of the oscilla tor t o stabilize. when releasing the halt mode by resetting, the internal ram data keeps the state before the halt instruction is executed. however the other settings contents are initialized. (releasing due to interrupts keeps the state before the halt instruction is executed.)
tmp92cy23/cd23a 2009-08-28 92cy23-33 table 3.3.4 source of halt state cl earance and halt clearance operation status of received interrupt interrupt enabled ( interrupt level) (interrupt mask) interrupt disabled ( interrupt level) < (interrupt mask) halt mode idle2 idle1 stop idle2 idle1 stop nmi ? ? ?* 1 ? ? ? intwdt ? ? ? ? int0 to int4, int7 (note 1) ? ? ? * 1 * 1 int5,int6 (port) (note 1) ? ? ? * 1 * 1 int5,int6 (tmrb1) ? intta0 to intta5 ? intb00, inttb01, inttb10, inttb11, inttbo0, inttbo1 ? intrx0 to intrx2, inttx0 to inttx2 ? intad ? kwi ? ? ? * 1 intrtc ? ? intsbe0 to intsbe1 ? interrupt inthsc (note4) ? source of halt state clearance reset initialize lsi ? : after clearing the halt mode, cpu starts interrupt processing. : after clearing the halt mode, cpu resumes executing starting from the instruction following the halt instruction. : cannot be used to release the halt mode. ? : the priority level (interrupt request level) of non-m askable interrupts is fixed to 7, the highest priority level. this combination is not available. : since kwi does not have a function as interr uption, this combination does not exist. * 1: release of the halt mode is exec uted after warm-up time has elapsed. note 1: when the halt mode is cleared by an int0 to 7 interrupt of the level mode in the interrupt enabled status, hold level ?h? until starting interrupt processing. if level ?l ? is set before holding level ?l?, interrupt processing is correctly started. note 2: although a kwi can cancel all halt mode st ates, the function as inte rruption does not have it. note 3: specify the hscsel register when selecting inttx1 or inthsc interrupt with the same interrupt factor. note4: the inthsc interrupt is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-34 example: releasing idle1 mode an int0 interrupt clears the halt st ate when the device is in idle1 mode. address 8200h ld (p7fc), 10h ; sets p74 to int0 interrupt. 8203h ld (iimc3), 00h ; selects int0 interrupt rising edge. 8206h ld (iimc2), 00h ; selects int0 interrupt edge 8209h ld (inte01), 06h sets int0 interrupt level to 6. 820bh ei 5 ; sets interrupt level to 5 for cpu. 820eh ld (syscr2), 28h ; sets halt mode to idle1 mode. 820fh halt ; halts cpu. int0 int0 interrupt routine reti 8210h ld xx, xx
tmp92cy23/cd23a 2009-08-28 92cy23-35 (3) operation 1. idle2 mode in idle2 mode only specific internal i/o operations, as designated by the idle2 setting register, can take place. instruction execution by the cpu stops. figure 3.3.6 illustrates an example of the timing for clearance of the idle2 mo de halt state by an inte rrupt. figure 3.3.6 timing chart for idle2 mo de halt state cleared by interrupt 2. idle1 mode in idle1 mode, only the internal oscillator and special timer for clock continue to operate. the system clock stops. in the halt state, the interrupt request is sampled asynchronously with the system clock; however, clearance of the halt state (e.g., restart of operation) is synchronous with it. figure 3.3.7 illustrates the timing for clearance of the idle1 mode halt state by an interrupt. figure 3.3.7 timing cha rt for idle1 mo de halt state cleared by interrupt data data idle2 mode x1 a0 to a23 d0 to d15 rd wr interrupt for release halt data data idle1 mode x1 a0 to a23 d0 to d15 rd wr interrupt for release halt
tmp92cy23/cd23a 2009-08-28 92cy23-36 3. stop mode when stop mode is selected, all internal circuits stop, including the internal oscillator. after stop mode has been cleared system clock output starts when the warm-up time by the counter for a warm-u p of internal oscillator and built-in flashrom warm-up time. the example of a setting of the warm-up time at the time of stop mode release is shown in table 3.3.5. the warm-up time of built-in flashrom is shown in t able 3.3.6. note: although this product is a maskrom product, in order to consider as the same operation as a flashrom product, built-in flashrom warm-up time enters. figure 3.3.8 illustrates the timing for clearance of the stop mode halt state by an int errupt. figure 3.3.8 timing chart for stop mo de halt state cleared by interrupt table 3.3.5 example of warm-up time after releasing stop mode at f osch = 10 mhz, fs = 32.768 khz syscr2 syscr1 01 (2 8 ) 10 (2 14 ) 11 (2 16 ) 0 (fc) 25.6 s 1.638 ms 6.554 ms 1 (fs) 7.8 ms 500 ms 2000 ms table 3.3.6 example of warm-up time after built-i n flashrom (at the time of stop mode release) at f osch = 10 mhz, fs = 32.768 khz 0 (fc) 409.6 s (2 12 /f osch ) 1 (fs) 125 ms (2 12 /fs ) data data stop mode x1 a0 to a23 d0 to d15 rd wr interrupt for release halt warm-up time of internal osillator + warm-up time of built-in flashrom
tmp92cy23/cd23a 2009-08-28 92cy23-37 table 3.3.7 input buffer state table input buffer state in halt mode (stop) when the cpu is operating in halt mode (idle1/2) drve = ?1? drve = ?0? port name input function name during reset when used as function pin when used as input pin when used as function pin when used as input pin when used as function pin when used as input pin when used as function pin when used as input pin p00-p07 d0-d7 p10-p17 d8-d15 on upon external read (*1) p40-p47 ? p50-p57 ? p60-p67 ? p70(*2) ? off p71-p73 (*2) ? off off off off p74 int0 on on on on oscillator on off on p76 xt1 port off off off off p77 ? off ? ? ? ? p83 wait off off pc0 ta0in off pc1 int1 pc2 int2 pc3 int3 pd0 int4 int5 on pd1 tb1in0 off int6 on pd2 tb1in1 off int7 on pd3 rxd2 pd4 sclk2, 2cts on on pf0 ? off off pf1 rxd0 pf2 sclk0, 0cts on on pf3 ? off off pf4 rxd1, hssi( *4) pf5 sclk1, 1cts on on on an0-an7(*3) off off on off pg0-pg7 ki0-ki7 on on on on pl0-pl2 an8-an10(*3) an11(*3) off off off pl3 adtrg off pn0 sck0 pn1 sda0 pn2 si0, scl0 pn3 sck1 pn4 sda1 pn5 si1, scl1 on off off off off nmi ? am0,am1 ? on on x1 ? off off reset ? on on ? on ? on ? on ? *1: on upon external read. on: the buffer is always turned on. a current flows through the input buffer if the input pin is not driven. *2: port having a pull-up/pull-down resistor. off: the buffer is always turned off. *3: ain input does not cause a current to flow through the buffer. ? : not applicable *4: hssi input function is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-38 table 3.3.8 output buffer state table output buffer state in halt mode (stop) when the cpu is operating in halt mode (idle1/2) drve = ?1? drve = ?0? port name output function name during reset when used as function pin when used as output pin when used as function pin when used as output pin when used as function pin when used as output pin when used as function pin when used as output pin p00-p07 d0-d7 p10-p17 d8-d15 off on upon external write (*1) off off p40-p47 a0-da7 p50-p57 a8-a15 p60-p67 a16-a23 p70(*2) rd on p71(*2) srwr p72(*2) srllb p73(*2) srlub off on on on on on on off p76 ? ? on(*3) ? on(*3) ? on(*3) ? oscillator on off on off off p77 xt2 port off on(*3) off on(*3) off on(*3) p80 0cs , ta1out p81 1cs , ta3out p82 2cs p83 3cs , ta5out on pd0 tb0out0 pd2 txd2 pd3 tb1out0 pd4 tb1out1, sclk2 pf0 txd0 off on on off pf1 ? ? ? ? ? pf2 sclk0, clk pf3 txd1, hsso( *4) on on on off pf4 ? ? ? ? ? pf5 sclk1, hsclk( *4) pn0 sck0 pn1(*3) so0, sda0 pn2(*3) scl0 pn3 sck1 pn4(*3) so1, sda1 pn5(*3) scl1 off on on on on off x2 ? on on ? on ? off ? off ? *1: on upon external write. on: the buffer is always turned on. when the bus is released, however, output buffers for some pins are turned off. *2: port having a pull-up resistor (programmable) off: the buffer is always turned off. *3: open-drain output pin. ? : not applicable *4: hsso and hsclk output functions are not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-39 3.4 interrupts interrupts are controlled by the cpu interrupt mask register and by the built-in interrupt controller. the tmp92cy23 has a total of 50 interrupts, tmp92cd23a has a total of 51 interrupts. interrupts generated by cpu: 9 sources software interrupts: 8 sources illegal instruction interrupt: 1 source internal interrupts: tmp92cy23: 32 sources, tmp92cd2 3a: 33 sources internal i/o interrupts: tmp92cy23: 24 sources, tmp92cd23a: 25 sources micro dma transfer end interrupts: 8 sources external interrupts: 9 sources interrupts on external pins (int0 to int7, nmi ) a fixed individual interrupt vector number is assigned to each interrupt source. any one of six levels of priority can also be assigned to each maskable interrupt. non-maskable interrupts have a fixed priority level of 7, the highest level. when an interrupt is generated, the interrupt controller sends the priority of that interrupt to the cpu. when more than one interrupt is generated simultaneously, the interrupt controller sends the priority value of the interrupt with the highest priority to the cpu. (the highest priority level is 7, the level used for non-maskable interrupts.) the cpu compares the interrupt priority level which it receives with the value held in the cpu interrupt mask register . if the prio rity level of the interrupt is greater than or equal to the value in the interrupt mask register, the cpu accepts the interrupt. however, software interrupts and illegal instruction interrupts generated by the cpu are processed irrespective of the value in . the value in the interrupt mask register can be changed using the ei instruction (ei num sets to num). for example, the command ei 3 enables the acceptance of all non-maskable interrupts and of maskable interrupts whose priority level, as set in the interrupt controller, is 3 or higher. the commands ei and ei 0 enable the acceptance of all non-maskable interrupts and of maskable interrupt s with a priority level of 1 or above (hence both are equivalent to the command ei 1). the di instruction (sets to 7) is exactly equivalent to the ei 7 instruction. the di instruction is used to disable all maskable interrupts (since the priority level for maskable interrupts ranges from 1 to 6). the ei instruction takes effect as soon as it is executed. in addition to the general purpose interrupt pr ocessing mode described above, there is also a micro dma processing mode. in micro dma mode the cpu automatically transfers data in one-byte, two-byte or four-byte blocks; this mode allows high-speed data transf er to and from internal and external memory and internal i/o ports. in addition, the tmp92cy23/cd23a also has a software start function in which micro dma processing is requested in software rather than by an interrupt. figure 3.4.1 is a flowchart showing overall interrupt processing.
tmp92cy23/cd23a 2009-08-28 92cy23-40 figure 3.4.1 interrupt and mi cro dma processing sequence micro dma soft start request interrupt processing interrupt vector calue ?v? read interrupt request f/f clear interrupt specified by micro dma start vector ? push pc push sr sr level of accepted interrupt + 1 intnest intnest + 1 pc (ffff00h + v) interrupt processing program reti instruction pop sr pop pc intnest intnest ? 1 end clear interrupt request flag yes no data transfer by micro dma count count ? 1 count = 0 no clear vector register generating micro dma transfer end interrupt inttc yes micro dma processing general-purpose interrupt processing
tmp92cy23/cd23a 2009-08-28 92cy23-41 3.4.1 general-purpose interrupt processing when the cpu accepts an interrupt, it usually performs the following sequence of operations. however, in the case of software interrupts and illegal instruction interrupts generated by the cpu, the cpu sk ips steps (1) and (3), and executes only steps (2), (4) and (5). (1) the cpu reads the interrupt vector from the interrupt controller. when more than one interrupt with the same priority level has been generated simultaneously, the interrupt controller gene rates an interrupt vector in accordance with the default priority and clears the interrupt requests. (the default priority is determined as follows: the smaller the vector value, the higher the priority.) (2) the cpu pushes the program counter (pc) and status register (sr) onto the top of the stack (pointed to by xsp). (3) the cpu sets the value of the cpu?s interrupt mask register to the priority level for the accepted interrupt plus 1. howe ver, if the priority level for the accepted interrupt is 7, the register?s value is set to 7. (4) the cpu increments the interrupt nesting counter intnest by 1. (5) the cpu jumps to the address given by adding the contents of address ffff00h + the interrupt vector, then starts the interrupt processing routine. on completion of interrupt processing, the ret i instruction is used to return control to the main routine. reti restores the contents of the program counter and the status register from the stack and decrements the interrupt nesting counter intnest by 1. non-maskable interrupts cannot be disabled by a user program. maskable interrupts, however, can be enabled or disabled by a user program. a program can set the priority level for each interrupt source. (a priority level setting of 0 or 7 will disable an interrupt request.) if an interrupt request is received for an inte rrupt with a priority level equal to or greater than the value set in the cpu interrupt mask register , the cpu will accept the interrupt. the cpu interrupt mask register is then set to the value of the priority level for the accepted interrupt plus 1. if during interrupt processing, an interrupt is generated with a higher priority than the interrupt currently being processed, or if, during the processing of a non-maskable interrupt processing, a non-maskable interrupt request is generated from another source, the cpu will suspend the routine which it is currently executing and accept the new interrupt. when processing of the new interrupt has been completed, the cpu will resume processing of the suspended interrupt. if the cpu receives another interrupt request while performing processing steps (1) to (5), the new interrupt will be sampled immediately af ter execution of the first instruction of its interrupt processing routine. specifying di as the start instruction disables nesting of maskable interrupts. a reset initializes the interrupt mask register to ?111?, disabling all maskable interrupts. table 3.4.1 shows the tmp92cy23/cd23a interrupt vectors and micro dma start vectors. ffff00h to ffffffh (256 bytes) is de signated as the interrupt vector area.
tmp92cy23/cd23a 2009-08-28 92cy23-42 table 3.4.1 tmp92cy23/cd23a interrupt vectors and micro dma start vectors default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 1 reset or [swi0] instruction 0000h ffff00h 2 [swi1] instruction 0004h ffff04h 3 illegal instruction or [swi2] instruction 0008h ffff08h 4 [swi3] instruction 000ch ffff0ch 5 [swi4] instruction 0010h ffff10h 6 [swi5] instruction 0014h ffff14h 7 [swi6] instruction 0018h ffff18h 8 [swi7] instruction 001ch ffff1ch 9 nmi : external interrupt input pin 0020h ffff20h 10 non- maskable intwd: watchdog timer 0024h ffff24h ? micro dma ? ? ? (note1) 11 int0: int0 pin input 0028h ffff28h 0ah ( note 2) 12 int1: int1 pin input 002ch ffff2ch 0bh ( note 2) 13 int2: int2 pin input 0030h ffff30h 0ch ( note 2) 14 int3: int3 pin input 0034h ffff34h 0dh ( note 2) 15 int4: int4 pin input 0038h ffff38h 0eh ( note 2) 16 int5: int5 pin input 003ch ffff3ch 0fh ( note 2) 17 int6: int6 pin input 0040h ffff40h 10h ( note 2) 18 int7: int7 pin input 0044h ffff44h 11h ( note 2) 19 intta0: 8-bit timer 0 0048h ffff48h 12h 20 intta1: 8-bit timer 1 004ch ffff4ch 13h 21 intta2: 8-bit timer 2 0050h ffff50h 14h 22 intta3: 8-bit timer 3 0054h ffff54h 15h 23 intta4: 8-bit timer 4 0058h ffff58h 16h 24 intta5: 8-bit timer 5 005ch ffff5ch 17h 25 (reserved) 0060h ffff60h 18h 26 (reserved) 0064h ffff64h 19h 27 intrx0: serial receive (channel 0) 0068h ffff68h 1ah ( note 2) 28 inttx0: serial transmission (channel 0) 006ch ffff6ch 1bh 29 intrx1: serial receive (channel 1) 0070h ffff70h 1ch ( note 2) 30 inttx1: serial transmission (channel 1) inthsc: high speed serial (note4) 0074h ffff74h 1dh 31 intrx2: serial receive (channel 2) 0078h ffff78h 1eh ( note 2) 32 inttx2: serial transmission (channel 2) 007ch ffff7ch 1fh 33 (reserved) 0080h ffff80h 20h 34 (reserved) 0084h ffff84h 21h 35 intnsbe0: sbi0 i2cbus transfer end 0088h ffff88h 22h 36 (reserved) 008ch ffff8ch 23h 37 intnsbe1: sbi1 i2cbus transfer end 0090h ffff90h 24h 38 (reserved) 0094h ffff94h 25h 39 (reserved) 0098h ffff98h 26h 40 (reserved) 009ch ffff9ch 27h 41 (reserved) 00a0h ffffa0h 28h 42 (reserved) 00a4h ffffa4h 29h 43 inttb00: 16-bit timer 0 00a8h ffffa8h 2ah 44 inttb01: 16-bit timer 0 00ach ffffach 2bh 45 inttbo0: 16-bit timer 0 (overflow) 00b0h ffffb0h 2ch 46 inttb10: 16-bit timer 1 00b4h ffffb4h 2dh 47 inttb11: 16-bit timer 1 00b8h ffffb8h 2eh 48 inttbo1: 16-bit timer 1 (overflow) 00bch ffffbch 2fh 49 maskable intad: ad conversion end 00c0h ffffc0h 30h
tmp92cy23/cd23a 2009-08-28 92cy23-43 default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 50 intp0: protect 0 (write to sfr) 00c4h ffffc4h 31h 51 intrtc: special timer for clock 00c8h ffffc8h 32h 52 (reserved) 00cch ffffcch 33h 53 inttc0: micro dma end (channel 0) 00d0h ffffd0h 34h 54 inttc1: micro dma end (channel 1) 00d4h ffffd4h 35h 55 inttc2: micro dma end (channel 2) 00d8h ffffd8h 36h 56 inttc3: micro dma end (channel 3) 00dch ffffdch 37h 57 inttc4: micro dma end (channel 4) 00e0h ffffe0h 38h 58 inttc5: micro dma end (channel 5) 00e4h ffffe4h 39h 59 inttc6: micro dma end (channel 6) 00e8h ffffe8h 3ah 60 inttc7: micro dma end (channel 7) 00ech ffffech 3bh ? to ? maskable (reserved) 00f0h : 00fch fffff0h : fffffch ? to ? note 1: when initiating micro dma, set at edge detect mode. note 2: micro dma default priority. micro dma initiation takes priority over other maskable interrupts. note 3: specify the hscsel register when selecting inttx1 or inthsc that have the same interrupt factor in the default priority 30. note4: the inthsc interrupt is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-44 3.4.2 micro dma processing in addition to general purpose interrupt processing, the tmp92cy23/cd23a also includes a micro dma function. micro dma proc essing for interrupt requests set by micro dma is performed at the highest priority leve l for maskable interrupts (level 6), regardless of the priority level of the interrupt source. because the micro dma function is implemented through the cpu, when the cpu is placed in a stand-by state by a halt instruct ion, the requirements of the micro dma will be ignored (pending). micro dma supports 8 channels and can be tr ansferred continuously by specifying the micro dma burst function as below. (1) micro dma operation when an interrupt request is generated by an interrupt source specified by the micro dma start vector register, the micro dma triggers a micro dma request to the cpu at interrupt priority level 6 and starts processing the request. the eight micro dma channels allow micro dma processing to be set for up to eight types of interrupt at once. when micro dma is accepted, the interrupt request flip-flop assigned to that channel is cleared. data in one-byte, two-byte or four-byte blocks, is automatically transferred at once from the transfer source address to the transfer destination address set in the control register, and the tr ansfer counter is decremented by 1. if the value of the counter after it has been decremented is not 0, dma processing ends with no change in the value of the micro dma start vector register. if the value of the decremented counter is 0, a micro dma transfer end interrupt (inttc0 to inttc7) is sent from the cpu to the interrupt controll er. in addition, the micro dma start vector register is cleared to ?0?, the next micro dma operation is disabled and micro dma processing terminates. if micro dma requests are set simultaneously for more than one channel, priority is not based on the interrupt priority level but on the channel number: the lower the channel number, the higher the priority (channel 0 thus has the highest priority and channel 7 the lowest). if an interrupt request is triggered for the interrupt source in use during the interval between the time at which the micro dma star t vector is cleared and the next setting, general purpose interrupt processing is performed at the interrupt level set. therefore, if the interrupt is only being used to initiate micro dma (and not as a general-purpose interrupt), the interrupt level should first be set to 0 (i.e., interrupt requests should be disabled). if using micro dma and general-purpose inte rrupts together, first set the level of the interrupt used to start micro dma processing lower than all the other interrupt levels. (note) in this case, the cause of general interrupt is limited to the edge interrupt. the priority of the micro dma transfer end interrupt (inttc0 to inttc3) is defined by the interrupt level and the default prio rity as the same as the other maskable interrupt. note: if the priority level of micro dma is set higher than that of other interrupts, cpu operates as follows. in case intxxx interrupt is generated first and then intyyy interrupt is generated between checking ?interrupt specified by micro dma start vector? (in the figure 3.4.1) and reading interrupt vector with setting below. th e vector shifts to that of intyyy at the time. this is because the priority level of intyyy is higher than that of intxxx. in the interrupt routine, cpu reads the vector of intyyy because cheking of micro dma has finished. and intyyy is generated regardless of transfer counter of micro dma. intxxx: level 1 without micro dma intyyy: level 6 with micro dma
tmp92cy23/cd23a 2009-08-28 92cy23-45 if micro dma and general purpose interrupt s are being used together as described above, the level of the interrupt which is being used to initiate micro dma processing should first be set to a lower value than all the other interrupt levels. in this case, edge triggered interrupts are the only kinds of general interrupts which can be accepted. although the control registers used for setting the transfer source and transfer destination addresses are 32 bits wide, this type of register can only output 24-bit addresses. accordingl y, micro dma can only access 16 mbytes. three micro dma transfer modes are supported: one-byte transfers, two-byte transfer and four-byte transfer. after a transfer in any mode, the transfer source and transfer destination addresses will either be incremented or decremented, or will remain unchanged. this simplifies the transfer of data from memory to memory, from i/o to memory, from memory to i/o, and fr om i/o to i/o. for details of the various transfer modes, see section 3.4. 2 (4), detailed description of the transfer mode register. since a transfer counter is a 16-bit counter, up to 65536 micro dma processing operations can be performed per interrupt source (provided that the transfer counter for the source is initially set to 0000h). micro dma processing can be initiated by any one of 40 different interrupts ? the 39 interrupts shown in the micro dma start vectors in table 3.4.1 and a micro dma soft start. figure 3.4.2 shows a 2-byte transfer carried out us ing a mi cro dma cycle in transfer destination address inc mode (micro dma transfers are the same in every mode except counter mode). (the conditions for this cycle are as follows: this cycle is based on an external 8-bit bus, 0 waits, sou rce/transfer destination addresses both even-numbered values.) figure 3.4.2 timing for micro dma cycle state (1), (2): instruction fetch cycle (prefetc hes the next instruction code) if the instruction queue buffer is full, this cycle becomes a dummy cycle. state (3): micro dma read cycle state (4): micro dma write cycle state (5): (the same as in state (1), (2)) src 1 state f sys a 0 to a23 (1) dst (2) (3) (4) (5)
tmp92cy23/cd23a 2009-08-28 92cy23-46 (2) soft start function the tmp92cy23/cd23a can initiate micro dma either with an interrupt or by using the micro dma soft start function, in which micro dma is initiated by a write cycle which writes to the register dmar. writing ?1? to any bit of the register dmar causes micro dma to be performed once (if write ?0? to each bit, micro dma doesn?t operate). on completion of the transfer, the bits of dmar which support the end channel are automatically cleared to ?0?. only one channel can be set for dma request at once. (do not write ?1? to plural bits) when writing again ?1? to the dmar register, check whether the bit is 0 before writing 1. if read ?1?, micro dma transfer isn?t started yet. when a burst is specified by the register dmab, data is transferred continuously from the initiation of micro dma until the value in the micro dma transfer counter is ?0? after start up of the micro dma. if exec ute soft start during micro dma transfer by interrupt source, micro dma transfer counter doesn?t change. don?t use read-modify-write instruction to avoid writing to other bits by mistake. symbol name address 7 6 5 4 3 2 1 0 dreq7 dreq6 dreq5 dreq4 dre q3 dreq2 dreq1 dreq0 r/w 0 0 0 0 0 0 0 0 dmar dma request 109h (prohibit rmw) 1: dma request in software (3) transfer control registers the transfer source address and the tran sfer destination address are set in the following registers. an instruction of the form ldc cr, r can be used to set these registers. channel 0 dmas0 dma source address register 0: only use lsb 24 bits. dmad0 dma destination address register 0: only use lsb 24 bits. dmac0 dma counter register 0: 1 to 65536. dmam0 dma mode register 0. channel 7 dmas7 dma source address register 7. dmad7 dma destination address register 7. dmac7 dma counter register 7. dmam7 dma mode register 7. 8 bits 16 bits 32 bits
tmp92cy23/cd23a 2009-08-28 92cy23-47 (4) detailed description of the transfer mode register 0 0 0 mode dmam0 to dmam7 dmamn[4:0] mode description execution state number 0 0 0 z z destination inc mode (dmadn + ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 0 1 z z destination dec mode (dmadn ? ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 1 0 z z source inc mode (dmadn) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 1 1 z z source dec mode (dmadn) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 1 0 0 z z source and destination inc mode (dmadn + ) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 1 0 1 z z source and destination dec mode (dmadn ? ) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 1 1 0 z z source and destination fixed mode (dmadn) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 1 1 1 0 0 counter mode dmasn dmasn + 1 dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states zz: 00 = 1-byte transfer 01 = 2-byte transfer 10 = 4-byte transfer 11 = (reserved) note1: the execution state number shows number of best case (1-state memory access). 1state = 50ns at f sys = 20mhz note2: n stands for the micro dma channel number (0 to 7) dmadn + /dmasn + : post-increment (register value is incremented after transfer) dmadn ? /dmasn ? : post-decrement (register value is decremented after transfer) ?i/o? signifies fixed memory addresses; ?memory? signifies incremented or decremented memory addresses. note3: the transfer mode register should not be set to any value other than those listed above.
tmp92cy23/cd23a 2009-08-28 92cy23-48 3.4.3 interrupt controller operation the block diagram in figure 3.4.3 shows the interrupt circuits. the left hand side of the diagram shows the interrupt contr oller circu it. the right hand side shows the cpu interrupt request signal circuit and the halt release circuit. for each of the 50 interrupts channels there is an interrupt request flag (consisting of a flip-flop), an interrupt priori ty setting register and a micro dma start vector register. the interrupt request flag latches interrupt requests from the peripherals. the flag is cleared to ?0? in the following cases: when a reset occurs, when the cpu reads the channel vector of an interrupt it has received, when the cpu receives a mi cro dma request (when micro dma is set), when a micro dma burst transfer is terminated, and when an instruction that clears the interrupt for that channel is executed (by writing a micro dma start vector to the intclr register). an interrupt priority can be set independently for each interrupt source by writing the priority to the interrupt priority setting re gister (e.g., intepad or inte01). 6 interrupt priorities levels (1 to 6) are provided. setting an interrupt source?s priority level to 0 (or 7) disables interrupt requests from that sou rce. the priority of no n-maskable interrupt (watchdog timer interrupts) is fixed at 7. if more than one interrupt request with a given priority level are generated simultaneously, the default priority (the inte rrupt with the lowest priority or, in other words, the interrupt with the lowest vector value) is used to determine which interrupt request is accepted first. the 3rd and 7th bit of the interrupt priority setting register indicate the state of the interrupt request flag and thus whether an interrupt request for a given channel has occurred. if several interrupts are gene rated simultaneously, the interrupt controller sends the interrupt request for the interrupt with the highest priority and the interrupt?s vector address to the cpu. the cpu compares the mask value set in of the status register (sr) with the priority level of the re quested interrupt; if the latter is higher, the interrupt is accepted. then the cpu sets sr to the priority level of the accepted interrupt + 1. hence, during processing of the accepted interrupt, new interrupt requests with a priority value equal to or higher than the value set in sr (e.g., interrupts with a priority higher than the interrupt being processed) will be accepted. when interrupt processing has been co mpleted (e.g., after execution of a reti instruction), the cpu restores to sr the priority value which was saved on the stack before the interrupt was generated. the interrupt controller also includes eight registers which are used to store the micro dma start vector. writing the start vector of the interrupt source for the micro dma processing (see table 3.4.1), enables the corresponding interrupts to be processed by micro dm a pr ocessing. the values must be set in the micro dma parameter registers (e.g., dmas and dmad) prior to micro dma processing.
tmp92cy23/cd23a 2009-08-28 92cy23-49 figure 3.4.3 block diagram of interrupt controller int01 to int4, intrtc, input key interrupt re q uest si g nal if iff = 7 then 0 micro dma start vector setting registe r inttc0 inttc1 inttc2 inttc3 inttc4 inttc5 inttc6 inttc7 v = d0h v = d4h v = d8h v = dch v = e0h v = e4h v = e8h v = ech soft start micro dm a counter 0 interrupt 6 inttc0 during idle1 45 3 3 3 1 6 1 7 3 3 8 6 51 8 input or micro dma channel priority decoder priority encoder dma0v dma1v : dma7v reset interrupt request f/f reset decode r reset priority setting register v = 20h v = 24h interrupt controller cpu s q r v = 28h v = 2ch v = 30h v = 34h v = 38h v = 3ch v = 40h v = 44h v = 48h v = 4ch d q clr y1 y2 y3 y4 y5 y6 a b c dn dn + 1 dn + 2 interrupt request f/f interrupt vector read micro dma acknowledge interrupt request f/f dn + 3 a b c i n t errup t vector read d2 d3 d4 d5 d6 d7 selector s q r 0 1 2 3 4 5 6 7 a b c d0 d1 interrupt vector read interrupt mask f/f micro dma request halt release if intrq2 to 0 iff 2 to 0 then 1. intrq2 to 0 iff2 to 0 interrupt level detect reset ei 1 to 7 di interrupt request signal during stop micro dma channel specification reset intwd int0 int1 int2 int3 int4 int5 int6 int7 intta0 intta1 s interrupt vector generator  highest priority interrupt level select 1 2 3 4 5 6 7 d5 d4 d3 d2 d1 d0 d q clr nmi
tmp92cy23/cd23a 2009-08-28 92cy23-50 (1) interrupt level se tting registers symbol name address 7 6 5 4 3 2 1 0 int1 int0 i1c i1m2 i1m1 i1m0 i0c i0m2 i0m1 i0m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte01 int0 & int1 enable 00d0h 1:int1 interrupt request level 1:int0 interrupt request level int3 int2 i3c i3m2 i3m1 i3m0 i2c i2m2 i2m1 i2m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte23 int2& int3 enable 00d1h 1:int3 interrupt request level 1:int2 interrupt request level int5 int4 i5c i5m2 i5m1 i5m0 i4c i4m2 i4m1 i4m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte45 int4& int5 enable 00d2h 1:int5 interrupt request level 1:int4 interrupt request level int7 int6 i7c i7m2 i7m1 i7m0 i6c i6m2 i6m1 i6m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte67 int6& int7 enable 00d3h 1:int7 interrupt request level 1:int6 interrupt request level intta1(tmra1) intta0(tmra0) ita1c ita1m2 ita1m1 ita1m0 it a0c ita0m2 ita0m1 ita0m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta01 intta0 & intta1 enable 00d4h 1: intta1 interrupt request level 1:intta0 interrupt request level intta3(tmra3) intta2(tmra2) ita3c ita3m2 ita3m1 ita3m0 it a2c ita2m2 ita2m1 ita2m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta23 intta2 & intta3 enable 00d5h 1: intta3 interrupt request level 1:intta2 interrupt request level intta5(tmra5) intta4(tmra4) ita5c ita5m2 ita5m1 ita5m0 it a4c ita4m2 ita4m1 ita4m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta45 intta4 & intta5 enable 00d6h 1: intta5 interrupt request level 1: intta4 interrupt request level lxxm2 lxxm1 lxxm0 function (write) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests interrupt request flag
tmp92cy23/cd23a 2009-08-28 92cy23-51 symbol name address 7 6 5 4 3 2 1 0 inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes0 intrx0 & inttx0 enable 00d8h 1:inttx0 interrupt request level 1:intrx0 interrupt request level inttx1/inthsc (note) intrx1 itx1c itx1m2 itx1m1 itx1m0 irx1c irx1m2 irx1m1 irx1m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes1hsc intrx1 & inttx1/ inthsc enable 00d9h 1:inttx1 interrupt request level 1:intrx1 interrupt request level inttx2 intrx2 itx2c itx2m2 itx2m1 itx2m0 irx2c irx2m2 irx2m1 irx2m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes2 intrx2 & inttx2 enable 00dah 1:inttx2 interrupt request level 1:intrx2 interrupt request level ? intsbe0 ? ? ? ? isbe0c isbe0m2 isbe0m1 isbe0m0 ? ? r r/w ? ? ? ? 0 0 0 0 intesb0 intsbe0 enable 00dch always write ?0? 1:intsbe0 interrupt request level ? intsbe1 ? ? ? ? isbe1c isbe1m2 isbe1m1 isbe1m0 ? ? r r/w ? ? ? ? 0 0 0 0 intesb1 intsbe1 enable 00ddh always write ?0? 1:intsbe1 interrupt request level inttb01(tmrb0) inttb00(tmrb0) itb01c itb01m2 itb01m1 itb01m0 i tb00c itb00m2 itb00m1 itb00m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetb0 inttb00 & inttb01 enable 00e0h 1:inttb01 interrupt request level 1:inttb00 interrupt request level ? inttbo0(tmrb0) ? ? ? ? itbo0c itbo0m2 itbo0m1 itbo0m0 ? ? r r/w ? ? ? ? 0 0 0 0 intetbo0 inttbo0 (overflow) enable 00e1h always write ?0? 1:inttbo0 interrupt request level inttb11(tmrb1) inttb10(tmrb1) itb11c itb11m2 itb11m1 itb11m0 i tb10c itb10m2 itb10m1 itb10m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetb1 inttb10 & inttb11 enable 00e2h 1:inttb11 interrupt request level 1:inttb10 interrupt request level note: inthsc interrupt is not built into tmp92cy23. lxxm2 lxxm1 lxxm0 function (write) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests interrupt request flag
tmp92cy23/cd23a 2009-08-28 92cy23-52 symbol name address 7 6 5 4 3 2 1 0 ? inttbo1(tmrb1) ? ? ? ? itbo1c itbo1m2 itbo1m1 itbo1m0 ? ? r r/w ? ? ? ? 0 0 0 0 intetbo1 inttbo1 (overflow) enable 00e3h always write 0 1:inttbo1 interrupt request level intp0 intad ip0c ip0m2 ip0m1 ip0m0 iadc iadm2 iadm1 iadm0 r r/w r r/w 0 0 0 0 0 0 0 0 intepad intp0 & intad enable 00e4h 1:intp0 interrupt request level 1:intad interrupt request level ? intrtc ? ? ? ? irc irm2 irm1 irm0 ? ? r r/w ? ? ? ? 0 0 0 0 intertc intrtc enable 00e5h always write ?0? 1:intrtc interrupt request level nmi intwdt incnm ? ? ? incwd ? ? ? r ? r ? 0 ? ? ? 0 ? ? ? intnmwdt nmi & intwdt enable 00efh 1: nmi always write ?0? 1:intwdt always write 0 inttc1(dma1) inttc0(dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc01 inttc0 & inttc1 enable 00f0h 1:inttc1 interrupt request level 1:inttc0 interrupt request level inttc3(dma3) inttc2(dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc23 inttc2 & inttc3 enable 00f1h 1:inttc3 interrupt request level 1:inttc2 interrupt request level inttc5(dma5) inttc4(dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc45 inttc4 & inttc5 enable 00f2h 1:inttc5 interrupt request level 1:inttc4 interrupt request level inttc7(dma7) inttc6(dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc67 inttc6 & inttc7 enable 00f3h 1:inttc7 interrupt request level 1:inttc6 interrupt request level lxxm2 lxxm1 lxxm0 function (write) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests interrupt request flag
tmp92cy23/cd23a 2009-08-28 92cy23-53 (2) external interrupt control symbol name address 7 6 5 4 3 2 1 0 n m i r e e w 0 iimc interrupt input mode control 00f6h (prohibit rmw) nmi 0:falling 1:falling and rising i7le i6le i5le i4le i3le i2le i1le i0le w 0 0 0 0 0 0 0 0 iimc2 interrupt input mode control2 00fah (prohibit rmw) int7 0:edge 1:level int6 0:edge 1:level int5 0:edge 1:level int4 0:edge 1:level int3 0:edge 1:level int2 0:edge 1:level int1 0:edge 1:level int0 0:edge 1:level i7edge i6edge i5edge i4edge i3edge i2edge i1edge i0edge w 0 0 0 0 0 0 0 0 iimc3 interrupt input mode control3 00fbh (prohibit rmw) int7 0: rising /high 1: falling /low int6 0: rising /high 1: falling /low int5 0: rising /high 1: falling /low int4 0: rising /high 1: falling /low int3 0: rising /high 1: falling /low int2 0: rising /high 1: falling /low int1 0: rising /high 1: falling /low int0 0: rising /high 1: falling /low clrv7 clrv6 clrv5 clrv4 clrv3 clrv2 clrv1 clrv0 w 0 0 0 0 0 0 0 0 intclr interrupt clear control 00f8h (prohibit rmw) clear the interrupt request flag by the writing of a micro dma starting vector note 1: disable int0 to int7 reques ts before changing int0 to int7 pins mode from level sense to edge sense. setting example for case of int0: di ld (iimc2) ,xxxxxx0-b ; change from ?level? to ?edge?. ld (intclr), 0ah ; clear interrupt request flag. nop ; wait ei execution. nop nop ei x: don?t care, ? : no change note 2: see electrical characteristics in sect ion 4 for external interrupt input pulse width. note 3: in a setup of a port, when choosing a 16-bit timer input and performing capture control, int5 and int6 operate not according to a setup of iimc2 and iimc3 register but according to a setup of tb1mod.
tmp92cy23/cd23a 2009-08-28 92cy23-54 table 3.4.2 settings of external interrupt pin function interrupt pin shared pin mode setting method rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int0 p74 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int1 pc1 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int2 pc2 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int3 pc3 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int4 pd0 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int5 pd1 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int6 pd2 low level iimc2 = ?1?, iimc3 = ?1? rising edge iimc2 = ?0?, iimc3 = ?0? falling edge iimc2 = ?0?, iimc3 = ?1? high level iimc2 = ?1?, iimc3 = ?0? int7 pd3 low level iimc2 = ?1?, iimc3 = ?1?
tmp92cy23/cd23a 2009-08-28 92cy23-55 (3) sio receive interrupt control symbol name address 7 6 5 4 3 2 1 0 ? ir2le ir1le ir0le w w 0 1 1 1 simc sio interrupt mode control f5h (prohibit rmw) always write ?1? (note) 0: intrx2 edge mode 1: intrx2 level mode 0: intrx1 edge mode 1: intrx1 level mode 0: intrx0 edge mode 1: intrx0 level mode note: when you use interruption, be sure to set ?1? as the bit 7 of a simc register. intrx2 level enable 0 edge detect intrx2 1 ?h? level intrx2 intrx1 level enable 0 edge detect intrx1 1 ?h? level intrx1 intrx0 rising edge enable 0 edge detect intrx0 1 ?h? level intrx0
tmp92cy23/cd23a 2009-08-28 92cy23-56 (4) interrupt request flag clear register the interrupt request flag is cleared by writing the appropriate micro dma start vector, as given in table 3.4.1, to the register intclr. fo r exam ple, to clear the interrupt flag int0, perform the following register operation after execution of the di instruction. intclr 0ah clears interrupt request flag int0. symbol name address 7 6 5 4 3 2 1 0 clrv7 clrv6 clrv5 clrv4 clrv3 clrv2 clrv1 clrv0 w 0 0 0 0 0 0 0 0 intclr interrupt clear control f8h (prohibit rmw) interrupt vector (5) micro dma start vector registers these registers assign micro dma processing to sets which source corresponds to dma. the interrupt source whose micro dma start vector value matches the vector set in one of these registers is designated as the micro dma start source. when the micro dma transfer counter value reaches ?0?, the micro dma transfer end interrupt corresponding to the channel is sent to the interrupt controller, the micro dma start vector register is cleared, and th e micro dma start source for the channel is cleared. therefore, in order for micro dma processing to continue, the micro dma start vector register must be set again during processing of the micro dma transfer end interrupt. if the same vector is set in the micro dma start vector registers of more than one channel, the lowest numbered channel takes priority. accordingly, if the same vector is set in the micro dma start vector registers for two different channels, the interrupt generated on the lower numbered channel is executed until micro dma transfer is complete. if th e micro dma start vector for this channel has not been set in the channel?s micro dm a start vector register again, micro dma transfer for the higher-numbered channel will be commenced. (this process is known as micro dma chaining.)
tmp92cy23/cd23a 2009-08-28 92cy23-57 symbol name address 7 6 5 4 3 2 1 0 dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w 0 0 0 0 0 0 dma0v dma0 start vector 100h dma0 start vector dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w 0 0 0 0 0 0 dma1v dma1 start vector 101h dma1 start vector dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w 0 0 0 0 0 0 dma2v dma2 start vector 102h dma2 start vector dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w 0 0 0 0 0 0 dma3v dma3 start vector 103h dma3 start vector dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w 0 0 0 0 0 0 dma4v dma4 start vector 104h dma4 start vector dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w 0 0 0 0 0 0 dma5v dma5 start vector 105h dma5 start vector dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w 0 0 0 0 0 0 dma6v dma6 start vector 106h dma6 start vector dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w 0 0 0 0 0 0 dma7v dma7 start vector 107h dma7 start vector
tmp92cy23/cd23a 2009-08-28 92cy23-58 (6) specification of a micro dma burst specifying the micro dma burst function ca uses micro dma transfer, once started, to continue until the value in the transfer counter register reaches ?0?. setting any of the bits in the register dmab which correspond to a micro dma channel (as shown below) to 1 specifies that any micro dma transfer on that channel will be a burst transfer. symbol name address 7 6 5 4 3 2 1 0 dbst7 dbst6 dbst5 dbst4 dbst3 dbst2 dbst1 dbst0 r/w 0 0 0 0 0 0 0 0 dmab dma burst 108h 1: dma burst request
tmp92cy23/cd23a 2009-08-28 92cy23-59 (7) notes the instruction execution unit and the bus interface unit in this cpu operate independently. therefore, immediately before an interrupt is generated, if the cpu fetches an instruction which clears the co rresponding interrupt request flag, the cpu may execute this instruction in between accepting the interrupt and reading the interrupt vector. in this case, the cpu will read the default vector 0004h and jump to interrupt vector address ffff04h. to avoid this, an instruction which clears an interrupt request flag should always be placed after a di instruction. and in the case of setting an interrupt enable again by ei instruction after the execution of clearing instruction, execute ei instruction after clearing and more than 3 ? instructions (e.g., ?nop? 3 times). if it placed ei instruction without waiting nop instruction after execution of clearing instruction, interrupt will be en abled before request flag is cleared. in the case of changing the value of the interrupt mask register by execution of pop sr instruction, disable an interrupt by di instruction before execution of pop sr instruction. in addition, please note that the following two circuits are exceptional and demand special attention. in level mode int0 is not an edge triggered interrupt. hence, in level mode the interrupt request flip-flop for int0 does not function. the peripheral interrupt request passes through the s input of the flip-flop and becomes the q output. if the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. int0 to int7 level mode if the cpu enters the interrupt response sequence as a result of int0 going from ?0? to ?1?, int0 must then be held at ?1? until the interrupt response sequence has been completed. if int0 to int7 are set to level mode so as to release a halt state, int0 must be held at ?1? from the time int0 changes from ?0? to ?1? until the halt state is released. (hence, it is necessary to ensure that input noise is not interpreted as a ?0?, causing int0 to revert to ?0? before the halt state has been released.) when the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. interrupt request flags must be cleared using the following sequence. di ld (iimc2), 00h ; switches from level to edge. ld (intclr), 0ah ; clears interrupt request flag. nop ; wait ei execution nop nop ei intrx0 to intrx2 in level mode (the register simc set to ?0?), the interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. it cannot be cleared by writing intclr register. note: the following instructions or pin input state changes are equivalent to instructions which clear the interrupt request flag. int0 to int7: instructions which switch to level mode after an interrupt request has been generated in edge mode. the pin input changes from ?high to low? and ?low to high? after an interrupt request has been generated in level mode. (?h? ?l?, ?l? ?h?) intrx0 to intrx2: instructions which read the receive buffer.
tmp92cy23/cd23a 2009-08-28 92cy23-60 3.5 function of ports the tmp92cy23/cd23a i/o port pins are shown in table 3.5.1. in addition to functioning as general- purpose i/o ports, these pins are also used by the internal cpu and i/o functions. table 3.5.2 to table 3.5.4 list the i/o regist ers and thei r spec ifications. table 3.5.1 port functions (r: pu = with programmable pull-up resistor, u = with pull-up resistor) port name pin name number of pins i/o r i/o setting pin name for built-in function port 0 p00 to p07 8 i/o ? bit d0 to d7 port 1 p10 to p17 8 i/o ? bit d8 to d15 port 4 p40 to p47 8 i/o ? bit a0 to a7 port 5 p50 to p57 8 i/o ? bit a8 to a15 port 6 p60 to p67 8 i/o ? bit a16 to a23 p70 1 i/o pu bit rd p71 1 i/o pu bit srwr p72 1 i/o pu bit srllb p73 1 i/o pu bit srlub p74 1 input ? (fixed) int0 p76 1 i/o ? bit xt1 port 7 p77 1 i/o ? bit xt2 p80 1 output ? (fixed) 0cs , ta1out p81 1 output ? (fixed) 1cs , ta3out p82 1 output ? (fixed) 2cs port 8 p83 1 i/o ? bit 3cs , wait , ta5out pc0 1 input ? (fixed) ta0in pc1 1 input ? (fixed) int1 pc2 1 input ? (fixed) int2 port c pc3 1 input ? (fixed) int3 pd0 1 i/o ? bit int4,tb0out0 pd1 1 input ? (fixed) int5,tb1in0 pd2 1 i/o ? bit int6,tb1in1,txd2 pd3 1 i/o ? bit int7,tb1out0,rxd2 port d pd4 1 i/o ? bit tb1out1,sclk2, 2cts pf0 1 i/o ? bit txd0 pf1 1 i/o ? bit rxd0 pf2 1 i/o ? bit sclk0, 0cts , clk pf3 1 i/o ? bit txd1, hsso pf4 1 i/o ? bit rxd1, hssi port f pf5 1 i/o ? bit sclk1, 1cts , hsclk port g pg0 to pg7 8 input ? (fixed) an0 to an7,ki0 to ki7 port l pl0 to pl3 4 input ? (fixed) an8 to an11, adtrg (pl3) pn0 1 i/o ? bit sck0 pn1 1 i/o ? bit so0,sda0 pn2 1 i/o ? bit si0,scl0 pn3 1 i/o ? bit sck1 pn4 1 i/o ? bit so1,sda1 port n pn5 1 i/o ? bit si1,scl1 note: hsso,hssi and hsclk functions are not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-61 table 3.5.2 i/o registers and specifications (1/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 pnode input port x 0 output port x 1 0 port 0 p00 to p07 d0 to d7 bus x x 1 none none input port x 0 output port x 1 0 port 1 p10 to p17 d8 to d15 bus x x 1 none none input port x 0 output port x 1 0 port 4 p40 to p47 a0 to a7 output x x 1 none none input port x 0 output port x 1 0 port 5 p50 to p57 a8 to a15 output x x 1 none none input port x 0 output port x 1 0 port 6 p60 to p67 a16 to a23 output x x 1 none none input port (without pull-up) 0 0 0 input port (with pull-up) 1 0 0 output port x 1 0 p70 rd output x x 1 input port (without pull-up) 0 0 0 input port (with pull-up) 1 0 0 output port x 1 0 p71 srwr x x 1 input port (without pull-up) 0 0 0 input port (with pull-up) 1 0 0 output port x 1 0 p72 srllb x x 1 input port (without pull-up) 0 0 0 input port (with pull-up) 1 0 0 output port x 1 0 p73 srlub x x 1 input port x 0 0 p74 int0 x 0 1 input port x 0 output port (?0? output ) 0 1 output port (?hz? output ) 1 1 p76 xt1 input x x none input port x 0 output port (?0? output ) 0 1 output port (?hz? output ) 1 1 port 7 p77 xt2 output x x none none none
tmp92cy23/cd23a 2009-08-28 92cy23-62 table 3.5.3 i/o registers and specifications (2/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 pnode p80 to p81 output port x 0 0 0cs output x 1 0 p80 ta1out x x 1 1cs output x 1 0 p81 ta3out x x 1 output port x 0 p82 2 cs output x none 1 none input port x 0 0 0 output port x 1 0 0 wait input x 0 1 0 3cs output x 1 1 0 port 8 p83 ta5out x 1 0 1 none input port x 0 pc0 ta0in input x 1 input port x 0 pc1 int1 input x 1 input port x 0 pc2 int2 input x 1 input port x 0 port c pc3 int3 input x none 1 none none input port x 0 0 output port x 1 0 int4 input x 0 1 pd0 tb0out0 x 1 1 none input port x 0 0 int5input x 0 1 pd1 tb0in0 x none 1 0 input port x 0 0 0 output port x 1 0 0 int6 input x 0 0 1 tb0in1 input x 0 1 0 txd2 output (3-state) x 1 1 0 pd2 txd2 (open drain)output x 1 1 1 input port x 0 0 0 output port x 1 0 0 int7 input x 0 0 1 rxd2 input x 0 1 0 pd3 tb1out0 output x 1 1 0 input port x 0 0 0 output port x 1 0 0 sclk2 input , 2cts input x 0 0 1 sclk2 output x 1 0 1 port d pd4 tb1out1 x 1 1 0 none
tmp92cy23/cd23a 2009-08-28 92cy23-63 table 3.5.4 i/o registers and specifications (3/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 siocnt pnode input port x 0 0 output port x 1 0 txd0 output (open drain output ) x 0 1 pf0 txd0 output (3-state) x 1 1 none input port x 0 0 output port x 1 0 pf1 rxd0 input x 0 1 none input port x 0 0 0 output port x 1 0 0 sclk0 input , 0cts input x 0 1 0 sclk0 output x 1 1 0 pf2 clk output x 1 0 1 none input port x 0 0 0 output port x 1 0 0 txd1 output (open drain output ) x 0 1 0 txd1 output (3-state) x 1 1 0 pf3 hsso output (3-state) (note) x 1 1 none 1 input port x 0 0 0 output port x 1 0 0 rxd1 input x 0 1 0 pf4 hssi input (note) x 0 1 none 1 input port x 0 0 0 output port x 1 0 0 sclk1 input , 1cts input x 0 1 0 sclk1 output x 1 1 0 port f pf5 hsclk output (note) x 1 1 none 1 none input port x 0 an0 to an7 input x 1 port g pg0 to pg7 ki0 to ki7 input x none x none none none input port x 0 pl0 to pl3 an8 to an11 input x 1 port l pl3 adtrg x none 0 none none none input port x 0 0 pn0 to pn5 output port x 1 0 sck0 input x 0 1 pn0 sck0 output x 1 1 so0 output x 0 1 pn1 sda0 input/output x 1 1 si0 input x 0 1 pn2 scl0 input/output x 1 1 sck1 input x 0 1 pn3 sck1 output x 1 1 so1 output x 0 1 pn4 sda1 input/output x 1 1 si1 input x 0 1 port n pn5 scl1 input/output x 1 1 none none none note: hsso,hssi and hsclk functions are not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-64 3.5.1 port 0 (p00 to p07) port 0 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p0 cr and function register p0fc. in addition to functioning as a general-purpose i/o port, port 0 can also function as a data bus (d0 to d7). moreover, after reset release, since a device is set as an input port, when using it as a data bus (d0 to d7), it needs to set it as p0cr and p0fc. figure 3.5.1 port 1 interna data bus direction control (on bit basis) reset p0cr write r output latch p0 write s a selector b p0 read external access (data write) port 0 p00 to p07 (d0 to d7) function control p0fc write d0 to d7 external access (data read) output buffer
tmp92cy23/cd23a 2009-08-28 92cy23-65 port 0 register 7 6 5 4 3 2 1 0 bit symbol p07 p06 p05 p04 p03 p02 p01 p00 read/write r/w p0 (0000h) reset state data from external port (output latch register is cleared to ?0?) port 0 control register 7 6 5 4 3 2 1 0 bit symbol p07c p06c p05c p04c p03c p02c p01c p00c read/write w reset state 0 0 0 0 0 0 0 0 p0cr (0002h) function refer to following table port 0 function register 7 6 5 4 3 2 1 0 bit symbol p00f read/write w reset state 0 p0fc (0003h) function refer to following table port 0 function setting note1: a read-modify-write operation cannot be performed in p0cr and p0fc registers. note2: is bit x of p0cr register. figure 3.5.2 register for port 0 p0fc p0cr 0 1 0 input port 1 output port data bus (d0 to d7)
tmp92cy23/cd23a 2009-08-28 92cy23-66 3.5.2 port 1 (p10 to p17) port 1 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p1 cr and function register p1fc. in addition to functioning as a general-purpose i/o port, port1 can also function as a data bus (d8 to d15). moreover, after reset release, since a device is set as an input port, when using it as a data bus (d8 to d15), it need s to set it as p1cr and p1fc. figure 3.5.3 port 1 internal data bus direction control (on bit basis) reset p1cr write r output latch p1 write s a selector b p1 read external access (data write) port 1 p10 to p17 (d8 to 15) function control p1fc write d8 to d15 external access (data read) output buffer
tmp92cy23/cd23a 2009-08-28 92cy23-67 port 1 register 7 6 5 4 3 2 1 0 bit symbol p17 p16 p15 p14 p13 p12 p11 p10 read/write r/w p1 (0004h) reset state data from external port (output latch register is cleared to ?0?) port 1 control register 7 6 5 4 3 2 1 0 bit symbol p17c p16c p15c p14c p13c p12c p11c p10c read/write w reset state 0 0 0 0 0 0 0 0 p1cr (0006h) function refer to following table port 1 function register 7 6 5 4 3 2 1 0 bit symbol p10f read/write w reset state 0 p1fc (0007h) function refer to following table port 1 function setting note1: a read-modify-write operation cannot be performed in p1cr and p1fc registers. note2: is bit x of p1cr register. figure 3.5.4 register for port 1 p1fc p1cr 0 1 0 input port 1 output port data bus (d8 to d15)
tmp92cy23/cd23a 2009-08-28 92cy23-68 3.5.3 port 4 (p40 to p47) port4 is 8-bit general-purpose i/o ports. bits ca n be individually set as either inputs or outputs by control register p4cr and function register p4fc. in addition to functioning as a general-purpose i/o port, port4 can also function as an address bus (a0 to a7). moreover, after reset release, since a device is set as an input port, when using it as an address bus (a0 to a7), it need s to set it as p4cr and p4fc. figure 3.5.5 port 4 internal data bus direction control (on bit basis) reset p4cr write r output latch p4 write s b selector a p4 read port 4 p40 to p47 (a0 to a7) function control (on bit basis) p4fc write output buffer internal address bus a 0 to a7
tmp92cy23/cd23a 2009-08-28 92cy23-69 port 4 register 7 6 5 4 3 2 1 0 bit symbol p47 p46 p45 p44 p43 p42 p41 p40 read/write r/w p4 (0010h) reset state data from external port (output latch register is cleared to ?0?) port 4 control register 7 6 5 4 3 2 1 0 bit symbol p47c p46c p45c p44c p43c p42c p41c p40c read/write w reset state 0 0 0 0 0 0 0 0 p4 (0012h) function 0: input 1: output port 4 function register 7 6 5 4 3 2 1 0 bit symbol p47f p46f p45f p44f p43f p42f p41f p40f read/write w reset state 0 0 0 0 0 0 0 0 p4fc (0013h) function 0: port 1: address bus (a0 to a7) note1: a read-modify-write operation cannot be performed in p4cr and p4fc registers. note2: when using as address bus a0 to a7, set p4fc after set p4cr. figure 3.5.6 register for port 4
tmp92cy23/cd23a 2009-08-28 92cy23-70 3.5.4 port 5 (p40 to p47) port5 is 8-bit general-purpose i/o ports. bits ca n be individually set as either inputs or outputs by control register p5cr and function register p5fc. in addition to functioning as a general-purpose i/o port, port 5 can also function as an address bus (a8 to a15). moreover, after reset release, since a device is set as an input port, when using it as an address bus (a8 to a15), it need s to set it as p5cr and p5fc. figure 3.5.7 port 5 internal data bus direction control (on bit basis) reset p5cr write r output latch p5 write s b selector a p5 read port 5 p50 to p57 (a8 to a15) function control (on bit basis) p5fc write output buffer internal address bus a 8 to a15
tmp92cy23/cd23a 2009-08-28 92cy23-71 port 5 register 7 6 5 4 3 2 1 0 bit symbol p57 p56 p55 p54 p53 p52 p51 p50 read/write r/w p5 (0014h) reset state data from external port (output latch register is cleared to ?0?) port 5 control register 7 6 5 4 3 2 1 0 bit symbol p57c p56c p55c p54c p53c p52c p51c p50c read/write w reset state 0 0 0 0 0 0 0 0 p5 (0016h) function 0: input 1: output port 5 function register 7 6 5 4 3 2 1 0 bit symbol p57f p56f p55f p54f p53f p52f p51f p50f read/write w reset state 0 0 0 0 0 0 0 0 p5fc (0017h) function 0: port 1: address bus (a8 to a15) note1: a read-modify-write operation cannot be performed in p5cr and p5fc registers. note2: when using as address bus a8 to a15, set p5fc after set p5cr. figure 3.5.8 register for port 5
tmp92cy23/cd23a 2009-08-28 92cy23-72 3.5.5 port 6 (p60 to p67) port 6 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p6 cr and function register p6fc. in addition to functioning as a general-purpos e i/o port, port 6 can also function as an address bus (a16 to a23). moreover, after reset release, since a device is set as an input port, when using it as a address bus (a16 to a23), it need s to set it as p6cr and p6fc. figure 3.5.9 port 6 internal data bus direction control (on bit basis) reset p6cr write r output latch p6 write s b selector a p6 read port 6 p60 to p67 (a16 to a23) function control (on bit basis) p6fc write output buffer internal address bus a 16 to a23
tmp92cy23/cd23a 2009-08-28 92cy23-73 port 6 register 7 6 5 4 3 2 1 0 bit symbol p67 p66 p65 p64 p63 p62 p61 p60 read/write r/w p6 (0018h) reset state data from external port (output latch register is cleared to ?0?) port 6 control register 7 6 5 4 3 2 1 0 bit symbol p67c p66c p65c p64c p63c p62c p61c p60c read/write w reset state 0 0 0 0 0 0 0 0 p6cr (001ah) function 0: input 1: output port 6 function register 7 6 5 4 3 2 1 0 bit symbol p67f p66f p65f p64f p63f p62f p61f p60f read/write w reset state 0 0 0 0 0 0 0 0 p6fc (001bh) function 0: port 1: address bus (a16 to a23) note1: a read-modify-write operation cannot be performed in p6cr and p6fc registers. note2: when using as address bus a16 to a23, set p6fc after set p6cr. figure 3.5.10 register for port 6
tmp92cy23/cd23a 2009-08-28 92cy23-74 3.5.6 port 7 (p70 to p74, p76, p77) as for a port7, p70 to p73, and p76 and p77 are general-purpose i/o ports, and p74 is a port only for inputs. p76 and p77 become an open drain output, when it is set as an output port. moreover, p70 to p73 are ports with pull-up resistance. bits can be individually set as either inputs or outputs by control register p7 cr and function register p7fc. in addition to functioning as a general-pu rpose i/o port, port7 can also function as a cpu?s control. p70 to p73 has the function of rd strobe signal output as an object for external memory connection, and the output for sram control ( srwr , srllb and srlub ). p74 has the function of an external interrupt input (int0). p76 and p77 have the function of a low-frequency resonator connection (xt1, xt2). these setups become effective by setting ?1? as the applicable bit of p7cr and a p7fc register. the edge of the external interruption int0 and level selection are set up in iimc2 and iimc3 registers in an interruption controller. p70 to p74 become input mode by the reset action, and p76 and p77 become output mode (high impedance output). figure 3.5.11 port 7 (p70 to p73) internal data bus direction control ( on bit basis ) reset p7 read port p7 p70 ( rd ) p71 ( srwr ) p72 ( srllb ) p73 ( srlub ) p7 write output buffer s output latch p7cr write p7fc write function control (on bit basis) s a selector b rd , srwr srllb , srlub programmable pull-up p-ch s b selector a
tmp92cy23/cd23a 2009-08-28 92cy23-75 figure 3.5.12 port 7(p74) internal data bus function control (on bit basis) reset p7fc write p7 read select level/edge and select rising/falling iimc2 iimc3 int0 p74 (int0)
tmp92cy23/cd23a 2009-08-28 92cy23-76 figure 3.5.13 port7 (p76, p77) internal data bus s direction control (on bit basis) reset p7cr write p7 read low frequency clock p77 (xt2) s output latch p7 write (on by 1) s b selector a output buffer (open drain output) s direction control (on bit basis) p7cr write s output latch p7 write p7 read s b selector a output buffer (open drain output) p76 (xt1) enable signal for low fre q uenc y oscillato r
tmp92cy23/cd23a 2009-08-28 92cy23-77 port 7 register 7 6 5 4 3 2 1 0 bit symbol p77 p76 p74 p73 p72 p71 p70 read/write r/w r r/w reset state data from external port (output latch register is set to ?1?) data from external port data from external port (output latch register is set to ?1?) p7 (001ch) function ? ? ? 0(output latch register): pull-up resistor off 1(output latch register): pull-up resistor on port 7 control register 7 6 5 4 3 2 1 0 bit symbol p77c p76c p73c p72c p71c p70c read/write w w reset state 1 1 0 0 0 0 p7cr (001eh) function 0: input 1: output 0: input 1: output port 7 function register 7 6 5 4 3 2 1 0 bit symbol p74f p73f p72f p71f p70f read/write w reset state 0 0 0 0 0 p7fc (001fh) function 0: port 1: int0 0: port 1: srlub 0: port 1: srllb 0: port 1: srwr 0: port 1: rd note 1: when port p70 to p73 is used in the input mode, p7 register controls the built-in pull-up resistor. read-modify-write is prohibited in the input mode or the i/o mode. setting the built-in pull-up resistor may be depended on the states of the input pin. note 2: a read-modify-write operation cannot be performed in p7cr and p7fc registers. note 3: on using low-frequency resonator to p76, p77, it is necessary to set the following procedures to reduce the consumption power supply. ? connecting to a resonator p7cr ?11?, p7 ?00? ? connecting an oscillator p7cr ?11?, p7 ?10? figure 3.5.14 register for port 7
tmp92cy23/cd23a 2009-08-28 92cy23-78 3.5.7 port 8 (p80 to p83) ports 80 to 82 are 3-bit output ports, and port 83 is 1-bit i/o port. in addition to an output and an i/o port function, as for p80 and p81, a standard chip select signal output ( 0cs , 1cs ) and a 8-bit timer output (ta1out, ta3out), and p82 have a standard chip select signal output ( 2cs ), and p83 has the function of a standard chip select signal output ( 3cs ), a 8-bit timer output (ta5out), and a wait input ( wait ). these functions operate by setting the bit concerned of p8cr, p8fc, and p8fc2 register as ?1?. all bits of p8fc and p8fc2 are cleared to ?0? by the reset action, and p80 to p83 becomes an output port. moreover, the output latch of p82 is cleared to ?0? and the output latch of p80 to p81 and p83 is set to ?1?. (1) p80 ( 0cs , ta1out), p81 ( 1cs , ta3out) in addition to an output port function, ports p80 and p81 function as a standard chip select signal output ( 0cs , 1cs ) and a 8-bit timer output (ta1out, ta3out). figure 3.5.15 port 8 (p80, p81) a s selector b internal data bus function control (on bit basis) reset p8fc write p8 write p8 read p80 ( 0cs , ta1out) p81 ( 1cs , ta3out) function control2 (on bit basis) p8fc2 write s output latch s a selector b 0cs , 1cs ta1out, ta3out
tmp92cy23/cd23a 2009-08-28 92cy23-79 (2) p82 ( 2cs ) in addition to an output port function, a port p82 functions as a standard chip select signal output ( 2cs ). figure 3.5.16 port 8 (p82) a s selector b internal data bus function control (on bit basis) reset p8fc write p8 read p82 ( 2cs ) s output latch p8 write 2cs
tmp92cy23/cd23a 2009-08-28 92cy23-80 (3) p83( 3cs , wait , ta5out) in addition to an i/o port function, a port p83 functions as a standard chip select signal output ( 3cs ) and an 8-bit timer output (ta5out), and a wait input ( wait ). figure 3.5.17 port 8 (p83) s a selector b internal data bus function control (on bit basis) reset p8fc write p8cr write p8 read p83 ( wait 3cs , ta5out) function control2 (on bit basis) p8fc2 write s direction control (on bit basis) s a selector b 3cs p8 write s output latch s b selector a ta5out internal waitsignal
tmp92cy23/cd23a 2009-08-28 92cy23-81 port 8 register 7 6 5 4 3 2 1 0 bit symbol p83 p82 p81 p80 p8 (0020h) read/write r/w reset state data from external port (note1) 0 1 1 port 8 control register 7 6 5 4 3 2 1 0 bit symbol p83c p8cr (0022h) read/write w reset state 1 0: input 1: output port 8 function register 7 6 5 4 3 2 1 0 bit symbol p83f p82f p81f p80f p8fc (0023h) read/write w reset state 0 0 0 0 function 0 : port 1: wait , 3cs 0: port 1: 2cs 0: port 1: 1cs 0: port 1: 0cs port 8 function register 2 7 6 5 4 3 2 1 0 bit symbol p83f2 p81f2 p80f2 p8fc2 (0021h) read/write w w reset state 0 0 0 function 0: 1: ta5out 0: 1: ta3out 0: 1: ta1out 0 1 0 0 input port output port 0 1 reserved ta5out 1 0 wait 3cs 1 1 reserved reserved note 1: output latch register is set to ?1?. note 2: a read-modify-write operation cannot be performed in p8cr, p8fc and p8fc2 registers. note 3: when using p83 as a wait input, while setting it as p8cr = ?0?, p8fc = ?1?, it is necessary to set memory control register bxcs l or as ?011?. note 4: when setting a standard chip select signal ( 0cs to 3cs ) as an output, p8cr is set up after setting up p8fc. figure 3.5.18 register for port 8 wait , 3cs ,ta5out setting
tmp92cy23/cd23a 2009-08-28 92cy23-82 3.5.8 port c (pc0 to pc3) port c is a 4-bit input port. in addition to the input port function, port c has the input function (ta0in) of a 8-bit timer, and an external interrupt input function (int1 to int3). these functions operate by setting the bit concerned of pcfc register as ?1 ?. edge selection of ex ternal interrupt is set up in iimc2 and iimc3 register in an interrupt controller. all bits of pcfc are cleared to ?0? by the reset action, and all bits serve as an input port. (1) pc0 (ta0in) in addition to an i/o port function, a port pc0 has a function as a ta0in input of the timer channel 0. figure 3.5.19 port c (pc0) internal data bus ta0in pc read pc0(ta0in)
tmp92cy23/cd23a 2009-08-28 92cy23-83 (2) pc1 (int1), pc2 (int2), pc3 (int3) in addition to an input port function, port pc1 to pc3 has a function as an external interrupt input (int1 to int3). figure 3.5.20 port c (pc1, pc2 and pc3) internal data bus function control (on bit basis) reset pcfc write pc read pc1 (int1) pc2 (int2) pc3 (int3) int1 int2 int3 select level/edge and select rising/falling iimc2 iimc3
tmp92cy23/cd23a 2009-08-28 92cy23-84 port c register 7 6 5 4 3 2 1 0 bit symbol pc3 pc2 pc1 pc0 pc (0030h) read/write r reset state data from external port port c function register 7 6 5 4 3 2 1 0 bit symbol pc3f pc2f pc1f pc0f pcfc (0033h) read/write w reset state 0 0 0 0 function 0 : p o r t 1: int3 0: port 1: int2 0: port 1: int1 0: port 1: ta0in note1: a read-modify-write operation cannot be performed in pcfc register. note2: pc0 is not based on a functional setup of a port, but is inputted into ta0in of a 8-bit timer (tmra0). figure 3.5.21 register for port c
tmp92cy23/cd23a 2009-08-28 92cy23-85 3.5.9 port d (pd0 to pd4) port d is 4-bit i/o port (pd0, pd2 to pd4) and 1-bit input port (pd1). there are i/o of the serial channel 2, i/ o of a 16-bit timer (tmrb0, tmrb1), and an external interrupt input (int4 to int7) function in addition to an i/o port function. these functions operate by setting the bit concerned of pdcr, pdfc and pdfc2 register as ?1?. edge selection of external interrupt is set up in iimc2 and iimc3 register in an interrupt controller. all bits of pdcr, pd fc and pdfc2 are cleared to ?0? by the reset action, and all bits serve as an input port. (1) pd0 (int4, tb0out0) in addition to an i/o port function, a port pd0 has a function as a 16-bit timer output (tb0out0) and an external interrupt input (int4). figure 3.5.22 register for port d (pd0) internal data bus direction control (on bit basis) reset pdcr write pd write pd read pd0 (int4, tb0out0) function control (on bit basis) pdfc write r output latch s a selector b int4 tb0out0 select level/edge and select rising/falling iimc2 iimc3 s b selector a
tmp92cy23/cd23a 2009-08-28 92cy23-86 (2) pd1 (int5,tb1in0) in addition to the input port function, the port pd1 has a function as a 16-bit timer input (tb1in0) and an external interrupt input (int5). in a port setup, when choosing a 16-bit timer input and performing capture co ntrol, int5 disregards a setup of iimc2 and iimc3 registers, and operates according to a setup of tb1mod . figure 3.5.23 port d (pd1) internal data bus function control (on bit basis) pdfc write pd read pd1 (int5,tb1in0) function control2 (on bit basis) pcfc2 write select level/edge and select rising/falling iimc2 iimc3 tb1in0 int5 reset
tmp92cy23/cd23a 2009-08-28 92cy23-87 (3) pd2 (int6, tb1in1, txd2) in addition to the i/o port, pd2 has a function as a 16-bit timer input (tb1in1), an external interrupt input (int6), and a txd output (txd2) of the serial channel 2. when using this port as txd output (txd2), it can be set as open drain. in a port setup, when choosing a 16-bit ti mer input and performing capture control, int6 disregards a setup of iimc2 and iimc 3 registers, and operates according to a setup of tb1mod . figure 3.5.24 port d (pd2) internal data bus direction control (on bit basis) reset pdcr write pd read pd2 (int6, tb1in1,txd2) pdfc2 write function control2 (on bit basis) s b selector a function control (on bit basis) pdfc write int6 s a selector b txd2 r output latch pd write select level/edge and select rising/falling iimc2 iimc3 tb1in1 open drain possible = ?11?, = ?1?
tmp92cy23/cd23a 2009-08-28 92cy23-88 (4) pd3 (int7, tb1out0, rxd2) in addition to the i/o port function, the portd3 has a function as a 16-bit timer output (tb1out0), an external interrupt in put (int7), and a rxd input (rxd2) of the serial channel 2. figure 3.5.25 port d (pd3) internal data bus direction control (on bit basis) reset pdcr write pd read pd3 (int7, tb1out0,rxd2) pdfc2 write function control2 (on bit basis) s b selector a function control (on bit basis) pdfc write int7 s a selector b tb1out0 r output latch pd write select level/edge and select rising/falling iimc2 iimc3 rxd2
tmp92cy23/cd23a 2009-08-28 92cy23-89 (5) pd4 (tb1out1, sclk2, 2cts ) in addition to the i/o port function, pd 4 has a function as a 16-bit timer output (tb1out1), sclk i/o (sclk2) of the serial channel 2, or a cts input ( 2cts ). figure 3.5.26 port d (pd4) internal data bus direction control (on bit basis) reset pdcr write pd read pdfc2 write function control2 (on bit basis) s a selector b function control (on bit basis) pdfc write tb1out1 s a selector b pd4 (tb1out1,sclk2, 2cts ) r output latch pd write sclk2, 2cts sclk2 s a selector b
tmp92cy23/cd23a 2009-08-28 92cy23-90 port d register 7 6 5 4 3 2 1 0 bit symbol pd4 pd3 pd2 pd1 pd0 pd (0034h) read/write r/w r r/w reset state data from external port (note1) data from external port data from external port (note1) port d control register 7 6 5 4 3 2 1 0 bit symbol pd4c pd3c pd2c pd0c pdcr (0036h) read/write w reset state 0 0 0 0 function 0: input 1: output 0: input 1: output port d function register 7 6 5 4 3 2 1 0 bit symbol pd4f pd3f pd2f pd1f pd0f pdfc (0037h) read/write w reset state 0 0 0 0 0 function refer to following table port d function register 2 7 6 5 4 3 2 1 0 bit symbol pd4f2 pd3f2 pd2f2 pd1f2 pdfc2 (0035h) read/write w reset state 0 0 0 0 function refer to following table pd4 to pd0 function setting pd4 pd3 pd2 pd1 (note 3) pd0 (note 4) 0 , 0 , 0 input port input port input port input port input port 0 , 0 , 1 output port output port output port output port 0 , 1 , 0 reserved rxd2 tb1in1 tb1in0 int4 0 , 1 , 1 tb1out1 tb1out0 txd2(3-state) tb0out0 1 , 0 , 0 sclk2, 2cts input int7 int6 int5 1 , 0 , 1 sclk2 output reserved reserved 1 , 1 , 0 reserved reserved reserved reserved 1 , 1 , 1 reserved reserved txd2(o.d) note : , and are the bits x of pdfc2,pdfc and pdcr registers. note 1: output latch register is cleared to ?0?. note 2: there is no output latch register in pd1. note 3: a read-modify-write operation cannot be performed in pdcr, pdfc and pdfc2 registers. note 4: tb1in0 and tb1in1 input is inputted into the 16-bit timer tmrb1 irrespective of a functional setup of a port. note 5: rxd2, sclk2 input, and 2cts input are inputted into the serial channel 2 irrespective of a functional setup of a port. note 6: pd2 does not have a register for 3-state/open drain setup. moreover, there is no open drain function at the time of an output port. figure 3.5.27 register for port d
tmp92cy23/cd23a 2009-08-28 92cy23-91 3.5.10 port f (pf0 to pf5) port f is a 6-bit general-purpose i/o ports. all bits of pfcr, pffc and pffc2 are cleared to ?0? by the reset action, and all bits serve as an input port. in addition to an i/o port, there are i/o of th e serial channels 0 and 1, high speed serial channel (note) and an internal clock output function. these functions operate by setting the bit concerned of pfcr, pffc, pffc2, hscsel register as ?1?. all bits of pfcr, pffc, pffc2 and hscsel are cleared to ?0? by the re set action, and all bits serve as an input port. note: the high speed serial channel func tion is not built into tmp92cy23. (1) port f0 (txd0) in addition to an i/o port function, pf0 have a function as an output (txd0) of the serial channels 0. moreover, when using it as a txd output terminal, the output buffer has the open drain function in which a program is possible. an open drain function can be set up by the pffc , pfcr register. figure 3.5.28 port f (pf0) internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf0 (txd0) function control (on bit basis) pffc write r output latch s b selector a s a selector b txd0 open drain possible = ? 10?
tmp92cy23/cd23a 2009-08-28 92cy23-92 (2) pf1(rxd0) in addition to the i/o port, pf1 have a function as an input (rxd0) of the serial channels 0. figure 3.5.29 port f (pf1) internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf1 (rxd0) function control (on bit basis) pffc write r output latch s b selector a rxd0
tmp92cy23/cd23a 2009-08-28 92cy23-93 (3) pf2 ( cts0 , sclk0, clk) in addition to the i/o port, pf2 has a function as the cts input ( cts0 ), sclk i/o (sclk0), and the internal clock output (clk) of the serial channel 0. figure 3.5.30 port f (pf2) internal data bus direction control (on bit basis) reset pfcr write pf read pffc2 write function control2 (on bit basis) s a selector b function control (on bit basis) pffc write sclk0 output s a selector b pf2 (sclk0, 0cts ,clk) r output latch pf write sclk0, 0cts input clk output s b selector a
tmp92cy23/cd23a 2009-08-28 92cy23-94 (4) port f3 (txd1, hsso) in addition to an i/o port function, pf3 have a function as an output (txd1) of the serial channels 1 and output (hsso) of the high speed serial channels (note) . moreover, when using it as a txd output terminal, the output buffer has the open drain function in which a program is possible. an open drain function can be set up by the pffc , pfcr register. note: hsso output function is not built into tmp92cy23. figure 3.5.31 port f (pf3) direction control (on bit basis) reset pfcr write pf write pf read pf3 (txd1 hsso) function control (on bit basis) pffc write r output latch s b selector a s a selector b txd1 open drain possible = ? 10? uart/hsc control hscsel write s a selector b hsso internal data bus
tmp92cy23/cd23a 2009-08-28 92cy23-95 (5) pf4(rxd1, hssi) in addition to the i/o port, pf4 have a function as an input (rxd1) of the serial channels 0 and input (hssi) of high speed serial channels (note) . note: hssi input function is not built into tmp92cy23. figure 3.5.32 port f (pf4) direction control (on bit basis) reset pfcr write pf write pf read pf4 (rxd1, hssi) function control (on bit basis) pffc write r output latch s b selector a rxd1 uart/hsc control hscsel write s b selector a hssi internal data bus
tmp92cy23/cd23a 2009-08-28 92cy23-96 (6) pf5 ( cts1 , sclk1, hsclk) in addition to the i/o port function, pf5 has a function as the input ( cts1 ) or i/o (sclk1) of the serial channel 1 and output (hsclk) of high speed serial channels (note) . note: hsclk output function is not built into tmp92cy23. figure 3.5.33 port f (pf5) direction control (on bit basis) reset pfcr write pf write pf read pf5 (sclk1, cts1 , hsclk ) function control (on bit basis) pffc write r output latch s b selector a s a selector b sclk1 output uart/hsc control hscsel write s a selector b hsclk output cts1 sclk1 input internal data bus
tmp92cy23/cd23a 2009-08-28 92cy23-97 port f register 7 6 5 4 3 2 1 0 bit symbol pf5 pf4 pf3 pf2 pf1 pf0 pf (003ch) read/write r/w reset state data from external port (output latch register is cleared to ?0?) port f control register 7 6 5 4 3 2 1 0 bit symbol pf5c pf4c pf3c pf2c pf1c pf0c pfcr (003eh) read/write w reset state 0 0 0 0 0 0 function 0: input 1: output port f functon register 7 6 5 4 3 2 1 0 bit symbol pf5f pf4f pf3f pf2f pf1f pf0f pffc (003fh) read/write w reset state 0 0 0 0 0 0 function 0: port 1: sclk1 1cts 0: port 1: rxd1 0: port 1: txd1 0: port 1: sclk0 0cts 0: port 1: rxd0 0: port 1: txd0 port f functon register 2 7 6 5 4 3 2 1 0 bit symbol pf2f2 pffc2 (003dh) read/write w reset state 0 function 0: 1: clk sio1/ hsc control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? ? siocnt hscsel (00f4h) read/write r r/w reset state 0 0 0 0 0 0 0 0 function 0 : s i o 1 1: hsc note: hscsel register is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-98 pf5 to pf0 function setting pf2 pf1 pf0 0 , 0 , 0 input port input port input port 0 , 0 , 1 output port output port output port 0 , 1 , 0 sclk0, 0cts input rxd0 input txd0 (o.d output) 0 , 1 , 1 sclk0 output reserved txd0 (3-state) 1 , 0 , 0 reserved 1 , 0 , 1 clk output 1 , 1 , 0 reserved 1 , 1 , 1 reserved pf5 pf4 pf3 0 , 0 , 0 input port input port input port 0 , 0 , 1 output port output port output port 0 , 1 , 0 sclk1, 1cts input rxd1 input txd1 (o.d output) 0 , 1 , 1 sclk1 output reserved txd1 (3-state) 1 , 0 , 0 reserved reserved reserved 1 , 0 , 1 reserved reserved reserved 1 , 1 , 0 reserved hssi input (note) reserved 1 , 1 , 1 hsclk output (note) reserved hsso (3-state) (note) note : , and are the bits x of pffc2,pffc and pfcr registers. note 1: a read-modify-write operation cannot be performed in pdcr, pdfc and pdfc2 registers. note 2: pf0 and pf3 does not have a register for 3-state/ open drain setup. moreover, there is no open drain function at the time of an output port. note3: hsso,hssi and hsclk functions are not built into tmp92cy23. figure 3.5.34 register for port f
tmp92cy23/cd23a 2009-08-28 92cy23-99 3.5.11 port g (pg0 to pg7) port g is 8-bit general-purpose input ports. in addition to an input port function, there are an analog input for ad converters (an0 to an7) and a key input (ki0 to ki7) function for a key on wake up. these functions operate by setting the bit concerned of pgfc, kien register as "1". moreover, edge selection of a key input is set up by the kicr register. by the reset action, all bits of pgfc are set to ?1?, and all bits of kien are cleared to ?0?, and it becomes all bit analog input ports (port input disable). a key input is enabled by the kien register, and when the edge chosen in the kicr register is detected, the key on wake up in put kwi occurs. although a key on wake up input can release all halt mode states , there is no function as interrupt. figure 3.5.35 port g internal data bus pg to pg7 (ki0 to ki7) kwi rising/falling edge detection function control (on bit basis) pgfc write pg read reset pg0 to pg7 8 input or kei input rising/falling control ( on bit basis ) kicr write reset key input enable (on bit basis) kien write reset adreg read ad converter channel selector conversion result register
tmp92cy23/cd23a 2009-08-28 92cy23-100 port g register 7 6 5 4 3 2 1 0 bit symbol pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 pg (0040h) read/write r reset state data from external port (note1) port g function register 7 6 5 4 3 2 1 0 bit symbol pg7f pg6f pg5f pg4f pg3f pg2f pg1f pg0f pgfc (0043h) read/write w reset state 1 1 1 1 1 1 1 1 function 0: analog input 1: input port/key input key input enable register 7 6 5 4 3 2 1 0 bit symbol ki7en ki6en ki5en ki4en ki3en ki2en ki1en ki0en kien (13a0h) read/write w reset state 0 0 0 0 0 0 0 0 function ki7 input 0: disable 1: enable ki6 input 0: disable 1: enable ki5 input 0: disable 1: enable ki4 input 0: disable 1: enable ki3 input 0: disable 1: enable ki2 input 0: disable 1: enable ki1 input 0: disable 1: enable ki0 input 0: disable 1: enable key input control register 7 6 5 4 3 2 1 0 bit symbol ki7edge ki6edge ki5edge ki4edge ki3edge ki2edge ki1edge ki0edge kicr (13a1h) read/write w reset state 0 0 0 0 0 0 0 0 function ki7 edge 0: rising 1: falling ki6 edge 0: rising 1: falling ki5 edge 0: rising 1: falling ki4 edge 0: rising 1: falling ki3 edge 0: rising 1: falling ki2 edge 0: rising 1: falling ki1 edge 0: rising 1: falling ki0 edge 0: rising 1: falling pg7 to pg0 function setting 0 1 0 input port analog input 1 key input reserved note : and are the bits x of pgfc and kien registers. note 1: it operates as an analog input port (input port disable). note 2: a read-modify-write operation cannot be performed in pgfc,kien and kicr registers. note 3: the input channel selection of the ad conb erter is set by ad mode control register admod1. figure 3.5.36 register for port g
tmp92cy23/cd23a 2009-08-28 92cy23-101 3.5.12 port l (pl0 to pl3) port l is a 4-bit input port. in addition to an input port function, port l has the analog input function of an ad converter. moreover, pl3 has the adtrg function of an ad converter. when you use pl3 as an adtrg , set plfc as ?0?. all bits of a plfc register are set to ?1? by the reset action, and port l become analog input port (port input disable). figure 3.5.37 port l internal data bus adtrg (pl3 only) pl read pl0(an8) pl1(an9) pl2(an10) pl3(an11, adtrg ) ad converter channel selector ad read conversion result register function control (on bit basis) plfc write reset
tmp92cy23/cd23a 2009-08-28 92cy23-102 port l register 7 6 5 4 3 2 1 0 bit symbol pl3 pl2 pl1 pl0 pl (0054h) read/write r reset state data from external port (note1) port l function register 7 6 5 4 3 2 1 0 bit symbol pl3f pl2f pl1f pl0f plfc (0057h) read/write w reset state 1 1 1 1 function 0: analog input 1:input port (note3) note 1: it operates as an analog input port (input port disable). note 2: a read-modify-write operation cannot be performed in plfc register. note 3: the input channel selectino of the ad conver ter is set by ad mode control register admod1. moreover, a set up of ad trigger ( adtrg ) input permission is set by admod2. figure 3.5.38 register for port l
tmp92cy23/cd23a 2009-08-28 92cy23-103 3.5.13 port n (pn0 to pn5) port n is 6-bit general-purpose i/o ports. mo reover, pn1, pn2, pn4, and pn5 serve as an open drain output, when it is set as an output. there are the following functions in addition to an i/o port. ? the i/o function of the serial bus interface 0 (sck0, so0/sda0, si0/scl0) ? the i/o function of the serial bus interface 1 (sck1, so1/sda1, si1/scl1) these functions operate by setting the bit concerned of pncr, pnfc register as ?1?. all bits of pncr and pnfc are cleared to ?0? by the reset action, and all bits serve as an input port. moreover, all bits of an output latch are set to ?1?. (1) pn0 (sck0), pn3 (sck1) pn0 and pn3 are general-purpose i/o ports. it is also used as a sck (clock i/o signal in sio mode). figure 3.5.39 port n (pn0, pn3) internal data bus direction control (on bit basis) reset pncr write pn write pn read pn0(sck0) pn3(sck1) function control (on bit basis) pnfc write s output latch s b selector a sck0 input sck1 input s a selector b sck0 output sck1 out p ut
tmp92cy23/cd23a 2009-08-28 92cy23-104 (2) pn1 (sda0/so0), pn4 (sda1/so1) pn1 and pn4 are general-purpose i/o ports. it is also used as a so (data output signal in sio mode), and sda (data signal in i 2 cbus mode). moreover, these ports serve as an open drain output. figure 3.5.40 port n (pn1, pn4) internal data bus direction control (on bit basis) reset pncr write pn write pn read pn1(sda0,so0) pn4(sda1,so1) function control (on bit basis) pnfc write s output latch s b selector a sda0/sda1 input s a selector b sda0/sda1 output so0/so1 out p ut output buffer (open drain output)
tmp92cy23/cd23a 2009-08-28 92cy23-105 (3) pn2 (scl0/si0), pn5 (scl1/si1) pn2 and pn5 are general-purpose i/o ports. it is also used as a si (data input signal in sio mode), and scl (clock signal in i 2 cbus mode). moreover, these ports serve as an open drain output. figure 3.5.41 port n (pn2, pn5) internal data bus direction control (on bit basis) reset pncr write pn write pn read pn2(scl0,si0) pn5(scl1,si1) function control (on bit basis) pnfc write s output latch s b selector a si0/si1 input scl0/scl1 input s a selector b scl0/scl1 out p ut output buffer (open drain output)
tmp92cy23/cd23a 2009-08-28 92cy23-106 port n register 7 6 5 4 3 2 1 0 bit symbol pn5 pn4 pn3 pn2 pn1 pn0 pn (005ch) read/write r/w reset state data from external por t (output latch register is set to ?1?) port n control register 7 6 5 4 3 2 1 0 bit symbol pn5c pn4c pn3c pn2c pn1c pn0c pncr (005eh) read/write w reset state 0 0 0 0 0 0 function 0: input 1: output port n function register 7 6 5 4 3 2 1 0 bit symbol pn5f pn4f pn3f pn2f pn1f pn0f pnfc (005fh) read/write w reset state 0 0 0 0 0 0 function 0: port 1: si1, scl1 0: port 1: so1,sda1 0: port 1: sck1 0: port 1: si0, scl0 0: port 1: so0,sda0 0: port 1: sck0 pn5 to pn0 function setting pn5 pn4 pn3 pn2 pn1 pn0 0 , 0 , 0 input port input port input port input port input port input port 0 , 0 , 1 output port output port output port output port output port output port 0 , 1 , 0 si1 input so1 output sck1 input si0 input so0 output sck0 input 0 , 1 , 1 scl1 input/output sda1 input/output sck1 output scl0 input/output sda0 input/output sck0 output note : and are the bits x of pnfc and pncr registers. note 1: a read-modify-write operation cannot be performed in pnfc and pncr registers. figure 3.5.42 register for port n
tmp92cy23/cd23a 2009-08-28 92cy23-107 3.6 memory controller 3.6.1 functional overview the tmp92cy23/cd23a has a memory contro ller with a following features to control four programmable address spaces: (1) four programmable address spaces the memc can specify a start address and a block size for each of he four memory spaces. ? sram or rom: all cs spaces (cs0 to cs3) can be assigned. ? page-rom: only the cs2 space can be assigned. (2) memory specification the memc can specify the type of memory, sram or rom, to associate with the selected address spaces. (3) data bus size specification the data bus width is selectable from 8 an d 16 bits for the respective chip select spaces. (4) wait control the number of wait states to be inserted in to an external bus cycle is determined by the wait state bits of the control register and the wait input pin. the number of wait states of a read cycle and that of a write cycle can be specified individually. the number of wait states can be selected from the following 6 options. 0 wait state, 1 wait state, 2 wait states, 3 wait states, 4 wait states n wait states (controlled by the wait pin)
tmp92cy23/cd23a 2009-08-28 92cy23-108 3.6.2 control registers and memory access operations after reset this section describes the regi sters to control the memory co ntroller, their reset states and the necessary settings after reset. (1) control registers the control registers of the memory controller are listed below. ? control registers: bncsh/bncsl (n = 0 to 3, ex) configures the basic settings of the memory controller, such as the memory type, specification and the number of wait states to be inserted into a read or write cycle. ? memory start address register: msarn (n = 0 to 3) specifies a start a ddress for a selected address space. ? memory address mask register: mamr (n = 0 to 3) specifies a block size for a selected address space. ? page rom control register: pmemcr selects a method of accessing page-rom. (2) memory access opera tions after reset upon reset, only the control registers (b2csh and b2csl) for the cs2 space automatically becomes effective. then, the bus width specification bits of the control register for the cs2 space becomes undefined, this bit mu st be set before accessing the external cs2 spaces. at the same time, the address range eb tween 000000h and ffffffh is defined as the cs2 space (the b2csh is cleared to ?0?). then, the address spaces are configured by msarn and mamrn. the bncsh and bncsl registers are also set up. the bncsh must be set to ?1? to enable these settings.
tmp92cy23/cd23a 2009-08-28 92cy23-109 3.6.3 basic functions and register settings this section describes some of the memory controller f unctions, such as setting the address range for each address space, associating memory to the selected and setting the number of wait states to be inserted. (1) programming chip select spaces the address space is specified by two registers. the memory start address re gister (msarn) sp ecify the start address for the cs spaces. the memory controller compares the register value and the address every bus cycle. the address bit which is masked by the mamrn is not compared by the memory controller. the cs spaces size is determ ined by setting the memory address mask register. the set value in the register is compared with the cs spaces on the bus. if the result is a match, the memory contro ller sets the chip select signal ( csn ) to ?low?. (i) memory start a ddress registers the msar0 to msar3 specify the start addresses for the cs0 to cs3 spaces. the bits specify the upper 8 bi ts (a23 to a16) of the start address. the lower 16 bits of the start addre ss (a15 to a0) are assumed to be 0000h. accordingly, the start address can only be a multiple of 64 kbytes, ranging from 000000h to ff0000h. (ii) memory address mask registers the memory address mask register determines whether an address bit is compared or not. in register setting, ?0? is ?compare?, and ?1? is ?do not compare?. the address bits that can be set depends on the cs spaces. cs0: a20 to a8 cs1: a21 to a8 cs2 to cs3: a22 to a15 the upper bits are always compared. the cs space size is determined by the result of the comparison. the size to be set depending on the cs space is as follows. size (bytes) cs area 256 512 32 k 64 k 128 k 256 k 512 k 1 m 2 m 4 m 8 m cs0 cs1 cs2 to cs3 note: after reset, only the control register for the cs2 spac e is effective. the control register for the cs2 space has the b2m bit. if the b2m bit is cleared to ?0?, t he address range between 000000h and ffffffh is defined as the cs2 space. (the b2m bit is cleared to ?0? after rese t.) by setting the b2csh bit to ?1?, the start address and the block size can be arbitraril y specified, as in the other spaces.
tmp92cy23/cd23a 2009-08-28 92cy23-110 (iii) example of register setting to set the cs1 space 512 bytes from address 110000h, set the register as follows. msar1 register 7 6 5 4 3 2 1 0 bit symbol m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 specified value 0 0 0 1 0 0 0 1 m1s23 to m1s16 bits of the msar1 correspond to address a23 to a16. a15 to a0 are cleared to ?0?. therefore, if msar1 is set to the above mentioned value, the start address of the cs space is set to address 110000h. mamr1 register 7 6 5 4 3 2 1 0 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15 to m1v9 m1v8 specified value 0 0 0 0 0 0 0 1 m1v21 to m1v16 and m1v8 bits of the mamr1 are set whether addresses a21 to a16 and a8 are compared or not. in regi ster setting, ?0? is ?compare?, and ?1? is ?do not to compare?. m1v15 to m1v9 bits determine whether addresses a15 to a9 are compared or not with bit 1. a23 and a22 are always compared. when set as above, a23 to a9 are compared with the values that is set as the start addresses. therefore, the 512 byte s (addresses 110000h to 1101ffh) are set as cs1 spaces. if it is compared with the addresses on the bus, the chip select signal cs1 is set to ?low?. a23 to a21 are always compared with cs0 spaces. whether a20 to a8 are compared or not is determined by the register. similarly, a23 is always compared with cs2 space to cs3 space. whether a22 to a15 are compared or not is determined by the register. note: when the specified address space ov erlaps with the on- chip memory area, priority oreder of address spaces are as follows. on-chip i/o > on-chip memory > cs0 space > cs1 space > cs2 space > cs3 space the bexcsl and bexcsh registers specify the data bus width and number of wait states when an address outside the cs0 to cs3 spaces ( csex space) is accessed. these registers are always enabled for the csex space.
tmp92cy23/cd23a 2009-08-28 92cy23-111 (2) memory specification setting the bits specifies the memory type that is associated with each address spaces. the interface signal that corresponds to the specified memory type is generated. the memory type is specified as follows: bit (bncsh register) bnom1 bnom0 memory type 0 0 sram/rom (default) 0 1 reserved 1 0 reserved 1 1 reserved (3) data bus width specification the data bus width can be specifie d for each address space by the bncsh bits as follows. bit (bncsh register) bnbus1 bnbus0 bus width 0 0 8-bit bus mode (note 2) 0 1 16-bit bus mode 1 0 reserved 1 1 reserved as described above, the tmp92cy23/cd23 a supports dinamic bus sizing, which allows the controller to transfer operands to or from the selected address spaces while automatically determining the data bus width. on which part of the data bus the data is actually placed is determined by the data size, bus width and start address. the table below provides a detailed description of the actual bus operation. note1: if two memories with different bus widths are assigned to consecutive addresses, do not execute an instruction that accesses the addresses crossing the boundary between those memories. otherwise, a read/write operation might not be performed correctly note2: upon reset, the bus width specification bits of t he control register for the cs 2 space (b2csh ) becomes undefined, this bit must be set bef ore accessing the external cs2 spaces.
tmp92cy23/cd23a 2009-08-28 92cy23-112 cpu data operand data size (bit) operand start address memory data size (bit) cpu address d32 to d24 d23 to d16 d15 to d8 d7 to d0 4n + 0 8/16 4n + 0 xxxxx xxxxx xxxxx b7 to b0 8 4n + 1 xxxxx xxxxx xxxxx b7 to b0 4n + 1 16 4n + 1 xxxxx xxxxx b7 to b0 xxxxx 4n + 2 8/16 4n + 2 xxxxx xxxxx xxxxx b7 to b0 8 4n + 3 xxxxx xxxxx xxxxx b7 to b0 8 4n + 3 16 4n + 3 xxxxx xxxxx b7 to b0 xxxxx (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 4n + 0 16 4n + 0 xxxxx xxxxx b15 to b8 b7 to b0 (1) 4n + 1 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 2 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 1 xxxxx xxxxx b7 to b0 xxxxx 4n + 1 16 (2) 4n + 2 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 2 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 4n + 2 16 4n + 2 xxxxx xxxxx b15 to b8 b7 to b0 (1) 4n + 3 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 3 xxxxx xxxxx b7 to b0 xxxxx 16 4n + 3 16 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 2 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 3 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 0 xxxxx xxxxx b15 to b8 b7 to b0 4n + 0 16 (2) 4n + 2 xxxxx xxxxx b31 to b24 b23 to b16 (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 2 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 3 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 1 xxxxx xxxxx b7 to b0 xxxxx (2) 4n + 2 xxxxx xxxxx b23 to b16 b15 to b8 4n + 1 16 (3) 4n + 4 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 2 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 3 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 4 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 5 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 2 xxxxx xxxxx b15 to b8 b7 to b0 4n + 2 16 (2) 4n + 4 xxxxx xxxxx b31 to b24 b23 to b16 (1) 4n + 3 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 5 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 6 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 3 xxxxx xxxxx b7 to b0 xxxxx (2) 4n + 4 xxxxx xxxxx b23 to b16 b15 to b8 32 4n + 3 16 (3) 4n + 6 xxxxx xxxxx xxxxx b31 to b24 xxxxx: the input data placed on the data bus indicated by this symbol is i gnored during a read operation. during a write operation, the bus is in the high-impedance state, and the write strobe signal remains inactive.
tmp92cy23/cd23a 2009-08-28 92cy23-113 (4) wait control the external bus cycle completes in two states at minimum (100 ns at f sys = 20 mhz) without inserting a wait state. setting up the bncsl specifies the number of wait states to be inserted in a write cycle, and setting the bits specifies the number of wait states to be inserted in a read cycle. the external bus cycle can be programmed as follows; bncsl register / bnww2 bnww1 bnww0 bnwr2 bnwr1 bnwr0 number of wait states 0 0 1 2states (0 wait state), fixed wait-state mode 0 1 0 3states (1 wait state), fixed wait-state mode (default) 1 0 1 4states (2 wait states), fixed wait-state mode 1 1 0 5states (3 wait states), fixed wait-state mode 1 1 1 6states (4 wait states), fixed wait-state mode 0 1 1 wait pin input mode other than the above reserved (i) fixed wait-state mode the bus cycle is completed in the specified number of states. the number of states can be selected from 2 (0 wait state) through 6 (4 wait states). (ii) wait pin input mode in this mode, the wait signal is sampled. a wait state is continued to be inserted while the wait signal is sampled active. the minimum bus cycle in this mode is two states. the bus cycle is completed if the wait signal is non-active (?high? level) at the second states. the bus cycle is extended as the wait signal remains active after second states.
tmp92cy23/cd23a 2009-08-28 92cy23-114 (5) insert recovery cycle if the plural memory which data-output-floating-time (t df ) is long (the external rom and etc.) are set, it is necessary to consider each other?s t df times. however, if bncsh is set, you can insert dummy cycle of 1- state just before the first bus cycle which start accessing to other cs space. bncsh 0 no dummy cycle is inserted (default). 1 dummy cycle is inserted. ? when no dummy cycle is inserted (0 wait state) ? when a dummy cycle is inserted (0 wait state) clk address csm csn rd clk address csm csn rd dummy
tmp92cy23/cd23a 2009-08-28 92cy23-115 (6) basic bus timing ? external bus read/write bus cycle (0 wait state) ? external bus read/write bus cycle (1 wait state) clk (20mhz) t1 t2 clk (20mhz) address cs rd d15 to d0 srwr d15 to d0 input read write srxxb out p ut tw d15 to d0 address cs t1 t2 rd srwr d15 to d0 in p ut read write srxxb output
tmp92cy23/cd23a 2009-08-28 92cy23-116 ? external bus read/write cycle (0 wait state at wait pin input mode) ? external bus read/write cycle (n wait state at wait pin input mode) t1 tw t2 in p ut output write sampling sampling wait address cs rd d15 to d0 srwr d15 to d0 clk (20mhz) srxxb r ea d in p ut output read write wait sampling address cs rd d15 to d0 srwr d15 to d0 clk (20mhz) srxxb t2 t1
tmp92cy23/cd23a 2009-08-28 92cy23-117 ? example of wait input cycle (5 wait state) csn srwr rd wait d q ck res d q ck res d q ck res d q ck res d q ck res clk ff0 ff1 ff2 ff3 ff4 clk (20 mhz) 12 3 4 5 6 7 csn rd wait ff_res ff0_d ff0_q ff1_q ff2_q ff3_q
tmp92cy23/cd23a 2009-08-28 92cy23-118 3.6.4 controlling the page mode access to rom this section describes page mode access operations to rom and the required register settings. the page mode operation to rom is specified by pmemcr. (1) operations and register settings the tmp92cy23/cd23a supports page mode accesses to rom. only the cs2 space can be configured for this mode of access. the page mode operation to rom is specified by the page rom control register, pmemcr. setting the pmemcr bit to ?1? sets the mode of memory access to the cs space to page mode. the number of cycles required for a read cycle is specified by the pmemcr bits. pmemcr opwr1 opwr0 number of cycles in page mode 0 0 1 cycle (n-1-1-1 mode) (n 2) 0 1 2 cycle (n-2-2-2 mode) (n 3) 1 0 3 cycle (n-3-3-3 mode) (n 4) 1 1 reserved note: specify the number of wait state ?n? usi ng the control register (b2csl) for cs2 space. the page size (the number of bytes) of rom as seen from the cpu is determined by pmemcr. when the specified page boundary is reached, the controller terminates the page read operation. the first data of the next page is read in the normal mode. then, the following da ta is read again in page mode. pmemcr pr1 pr0 rom page size 0 0 64 bytes 0 1 32 bytes 1 0 16 bytes 1 1 8 bytes (2) signal timing pulse figure 3.6.1 timing pulse diagram (when using a 8-bit setting) t h a data in p ut data in p ut data in p ut data in p ut t cyc a 0 to a23 clk d0 to d15 rd cs2 + 0 + 1 + 2 + 3 t ad3 t ad2 t ad2 t ad2 t hr t h a t h a t h a t1
tmp92cy23/cd23a 2009-08-28 92cy23-119 3.6.5 list of registers the memory control registers and the settings are described as follows. for the addresses of the registers, see section 5 ?table of special function registers (sfrs)?. (1) control registers the control register is a pair of bncsl and bncsh. (?n? is a number of the cs space.) bncsl has the same configuration rega rdless of the cs space. in bncsh, only b2csh which is corresponded to the cs2 space has a different configuration from the others. bncsl 7 6 5 4 3 2 1 0 bit symbol bnww2 bnww1 bnww0 bnwr2 bnwr1 bnwr0 read/write w w reset state 0 1 0 0 1 0 specifies the number of write waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) specifies the number of read waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = reserved b2csh 7 6 5 4 3 2 1 0 bit symbol b2e b2m ? b2rec b2om1 b2om0 b2bus1 b2bus0 read/write w reset state 1 0 0 0 0 0 undefined undefined : enable bit 0 = no chip select signal output. 1 = chip select signal output (default). note: after reset, only the enable bit of b2cs register is valid (?1?). : cs space specification 0 = sets the cs2 space to addresses 000000h to ffffffh (default). 1 = sets the cs2 space to programmable. note: after reset, the cs2 space is set to addresses 000000h to ffffffh. : sets the dummy cycle for data output recovery time. 0 = not insert a dummy cycle (default). 1 = insert a dummy cycle. 00 = sram or rom (default) others = reserved sets the data bus width. 00 = 8 bits 01 = 16 bits 10 = reserved 11 = reserved note: the value of bit is set according to the state of am<1:0> pin after reset.
tmp92cy23/cd23a 2009-08-28 92cy23-120 bncsh (n = 0, 1, 3) 7 6 5 4 3 2 1 0 bit symbol bne bnrec bnom1 bnom0 bnbus1 bnbus0 read/write w w reset state 0 0 0 0 0 0 : enable bit 0 = no chip select signal output (default). 1 = chip select signal output. note: after reset, only the enable bit b2e of b2cs register is valid (?1?). : sets the dummy cycle for data output. 0 = not insert a dummy cycle (default). 1 = insert a dummy cycle. 00 = sram or rom (default) 01 = reserved 10 = reserved 11 = reserved sets the data bus width. 00 = 8 bits (default) 01 = 16 bits 10 = reserved 11 = reserved bexcsl 7 6 5 4 3 2 1 0 bit symbol bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 read/write w w reset state 0 1 0 0 1 0 specifies the number of write waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) specifies the number of read waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = reserved bexcsh 7 6 5 4 3 2 1 0 bit symbol bexrec bexom1 bexom0 bexbus1 bexbus0 read/write w reset state 0 0 0 0 0 00 = sram or rom (default) 01 = reserved 10 = reserved 11 = reserved 00 = 8 bits (default) 01 = 16 bits 10 = reserved 11 = reserved
tmp92cy23/cd23a 2009-08-28 92cy23-121 (2) block address register a start address and an address area of th e cs spaces are specified by the memory start address register (msarn) and the me mory address mask register (mamrn). the memory start address register sets all start address similarly regardless of the cs spaces. the bit to be set by the mamrn is depended on the cs spaces. msarn (n = 0 to 3) 7 6 5 4 3 2 1 0 bit symbol mns23 mns22 mns21 mns20 mns19 mns18 mns17 mns16 read/write r/w reset state 1 1 1 1 1 1 1 1 sets a start address. sets the start address of the cs spaces. are corresponding to the address a23 to a16. mamr0 7 6 5 4 3 2 1 0 bit symbol m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14 to m0v9 m0v8 read/write r/w reset state 1 1 1 1 1 1 1 1 enables or masks comparison of the addresses. are corresponding to addresses a20 to a8. are corresponding to address a14 to a9 by 1 bit. if ?0? is set, the comparison between the value of the address bus and the start address is enabled. if ?1? is set, the comparison is masked. mamr1 7 6 5 4 3 2 1 0 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15 to m1v9 m1v8 read/write r/w reset state 1 1 1 1 1 1 1 1 enables or masks comparison of the addresses. are corresponding to addresses a21 to a8. are corresponding to address a15 to a9 by 1 bit. if ?0? is set, the comparison between the value of the address bus and the start address is enabled. if ?1? is set, the comparison is masked.
tmp92cy23/cd23a 2009-08-28 92cy23-122 mamrn (n = 2 to 3) 7 6 5 4 3 2 1 0 bit symbol mnv22 mnv21 mnv20 mnv19 mnv18 mnv17 mnv16 mnv15 read/write r/w reset state 1 1 1 1 1 1 1 1 enables or masks comparison of the addresses. are corresponding to addresses a22 to a15. if ?0? is set, the comparison between the value of the address bus and the st art address is enabled. if ?1? is set, the comparison is masked. after a reset, masr0 to msar3 and msar0 to mamr3 are set to ?ffh?. b0csh, b1csh, and b3csh are reset to ?0?. this disabling the cs0, cs1, and cs3 areas. however, b2csh< b2m> is reset to ?0? and b2csh to ?1?, and cs2 is enabled 000000h to ffffffh . also the bus width and number of waits specified in bexcsh/l are used for accessing address except the specified cs0 to cs3 area.
tmp92cy23/cd23a 2009-08-28 92cy23-123 (3) page rom control register (pmemcr) the page rom control register sets page rom accessing. rom page accessing is executed only in cs2 space. pmemcr 7 6 5 4 3 2 1 0 bit symbol opge opwr1 opwr0 pr1 pr0 read/write r/w reset state 0 0 0 1 0 enable bit 0 = no rom page mode accessing (default) 1 = rom page mode accessing specifies the number of waits. 00 = 1 state (n-1-1-1 mode) (n 2) (default) 01 = 2 states (n-2-2-2 mode) (n 3) 10 = 3 states (n-3-3-3 mode) (n 4) 11 = reserved note: set the number of waits ?n? to the control register (bncsl) in cs spaces. rom page size 00 = 64 bytes 01 = 32 bytes 10 = 16 bytes (default) 11 = 8 bytes
tmp92cy23/cd23a 2009-08-28 92cy23-124 table 3.6.1 control register (1/2) 7 6 5 4 3 2 1 0 b0csl bit symbol b0ww2 b0ww1 b0ww0 b0wr2 b0wr1 b0wr0 (0140h) read/write w w reset state 0 1 0 0 1 0 b0csh bit symbol b0e ? ? b0rec b0om1 b0om0 b0bus1 b0bus0 (0141h) read/write w reset state 0 0 (note1) 0 (note1) 0 0 0 0 0 mamr0 bit symbol m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14-v9 m0v8 (0142h) read/write r/w reset state 1 1 1 1 1 1 1 1 msar0 bit symbol m0s23 m0s22 m0s21 m0s20 m0s19 m0s18 m0s17 m0s16 (0143h) read/write r/w reset state 1 1 1 1 1 1 1 1 b1csl bit symbol b1ww2 b1ww1 b1ww0 b1wr2 b1wr1 b1wr0 (0144h) read/write w w reset state 0 1 0 0 1 0 b1csh bit symbol b1e ? ? b1rec b1om1 b1om0 b1bus1 b1bus0 (0145h) read/write w reset state 0 0 (note1) 0 (note1) 0 0 0 0 0 mamr1 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15-v9 m1v8 (0146h) read/write r/w reset state 1 1 1 1 1 1 1 1 msar1 bit symbol m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 (0147h) read/write r/w reset state 1 1 1 1 1 1 1 1 b2csl bit symbol b2ww2 b2ww1 b2ww0 b2wr2 b2wr1 b2wr0 (0148h) read/write w w reset state 0 1 0 0 1 0 b2csh bit symbol b2e b2m ? b2rec b2om1 b2om0 b2bus1 b2bus0 (0149h) read/write w reset state 1 0 0 (note1) 0 0 0 note3 note3 mamr2 bit symbol m2v22 m2v21 m2v20 m2v19 m2v18 m2v17 m2v16 m2v15 (014ah) read/write r/w reset state 1 1 1 1 1 1 1 1 msar2 bit symbol m2s23 m2s22 m2s21 m2s20 m2s19 m2s18 m2s17 m2s16 (014bh) read/write r/w reset state 1 1 1 1 1 1 1 1 b3csl bit symbol b3ww2 b3ww1 b3ww0 b3wr2 b3wr1 b3wr0 (014ch) read/write w w reset state 0 1 0 0 1 0 b3csh bit symbol b3e ? ? b3rec b3om1 b3om0 b3bus1 b3bus0 (014dh) read/write w reset state 0 0 (note) 0 (note) 0 0 0 0 0 mamr3 bit symbol m3v22 m3v21 m3v20 m3v19 m3v18 m3v17 m3v16 m3v15 (014eh) read/write r/w reset state 1 1 1 1 1 1 1 1 msar3 bit symbol m3s23 m3s22 m3s21 m3s20 m3s19 m3s18 m3s17 m3s16 (014fh) read/write r/w reset state 1 1 1 1 1 1 1 1
tmp92cy23/cd23a 2009-08-28 92cy23-125 table 3.6.2 control register (1/2) 7 6 5 4 3 2 1 0 bexcsh bit symbol bexrec bexom1 bexom0 bexbus1 bexbus0 (0159h) read/write w reset state 0 0 0 0 0 bexcsl bit symbol bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 (0158h) read/write w w reset state 0 1 0 0 1 0 pmemcr bit symbol opge opwr1 opwr0 pr1 pr0 (0166h) read/write r/w reset state 0 0 0 1 0 note 1: always write ?0?. note 2: a read-modify-write operation cannot be perfor med in bncsl, bncsh registers (n=0 to 3, ex). note3: upon reset, these bits become undefined, th is bit must be set before accessing the cs2 spaces.
tmp92cy23/cd23a 2009-08-28 92cy23-126 3.6.6 notes (1) timing for the cs and rd signals. if the load capacitance of the rd (read) signal line is greater than that of the cs (chip select) signal line, the deassertion timing of the read signal is delayed, which may lead to an unintentional extension of a read cycle. such an unintended read cycle extention, which is indicated as (a) in figure 3.6.2 may cause a problem. figure 3.6.2 delay read cycle of when the read signal is delayed example: when using an externally connected flash eeprom whose commands are compatible with the standard jedec commands, the toggle bit may not be read correctly. if the rising edge of the read signal in the cycle immediately preceding the flash eeprom access cycle does no t occur in time, a read cycle may be extended unintentilnally as indicated as indicated as (b) in figure 3.6.3. figure 3.6.3 flash eeprom toggle bit read cycle when the toggle bit is inverted due to this unexpected read cycle extension, the cpu read the toggle bit properly and it always reads the same value from the toggle bit. to avoid this situation, it is re commended to perform data polling. memory 1 chip select memory 2 chip select address clk (20 mhz) (a) rd address clk (20 mhz) flash eeprom chip select (b) toggle bit memory access toggle bit rd cycle 1 rd
tmp92cy23/cd23a 2009-08-28 92cy23-127 (2) the cautions at the time of the functional change of a csn . a chip select signal output has the ca se of a combination terminal with a general-purpose port function. in this case, an output latch register and a function control register are initialized by the reset action, and an object terminal is initialized by the port output (?1? or ?0?) by it. functional change although an object terminal is changed from a port to a chip sele ct signal output by setting up a function control register (pnfc register), the short pulse for several ns may be outputted to the changing timing. al though it does not become especially a problem when using the usual memory, it may become a problem when using a special memory. x x n+2 internal address bus function control signal pxx n n+2 a23 to a0 a port is set as csn . n output port csn internal signal external signal output pulse t ad3 * xx is a function register address.(when an output port is initialized by ?0?) the measure by software the countermeasures in s/w for avoiding this phenomenon are explained. since cs signal decodes the address of the access area and is generated, an unnecessary pulse is outputted by access to the object cs area immediately after setting it as a csn function. then, if internal area is accessed also immediately after setting a port as cs function, an unnecessary pulse will not output. 1. prohibition of use of an nmi function 2. the ban on interruption under functional change (di command) 3. a dummy command is added in order to carry out continuous internal access. 4. (access to a functional ch ange register is correspon ded by 16-bit command. (ldw command)) xx+1 n+2 internal address bus function control signal pxx n n+2 a23 to a0 a port is set as csn . xx output port csn internal signal external signal dummy access
tmp92cy23/cd23a 2009-08-28 92cy23-128 3.7 8-bit timers (tmra) the tmp92cy23/cd23a features 6 built-in 8-bit timers (tmra0-tmra5). these timers are paired into three modules: tmra01, tmra23 and tmra45. each module consists of two channels and can operate in any of the following four operating modes. ? 8-bit interval timer mode ? 16-bit interval timer mode ? 8-bit programmable square wave pulse generation output mode (ppg: variable duty cycl e with variable period) ? 8-bit pulse width modulation output mode (pwm: variable duty cycle with constant period) figure 3.7.1 to figure 3.7.3 show block diagrams fo r tmra01, tmra23 and tmra45. each chann e l consists of an 8-bit up counter, an 8-bit comparator and an 8-bit timer register. in addition, a timer flip-flop and a prescale r are provided for each pair of channels. the operation mode and timer flip-flops are cont rolled by a five-byte sfr (special function registers). each of the three modules (tmra01, tmra23 and tmra45) can be operated independently. all modules operate in the same manner; hence only the operation of tmra01 is explained here. table 3.7.1 registers and pins for each module module specification tmra01 tmra23 tmra45 input pin for external clock ta0in (shared with pc0) none none external pin output pin for timer flip-flop ta1out (shared with p80) ta3out (shared with p81) ta5out (shared with p83) timer run register ta01run (1100h) ta23run (1108h) ta45run (1110h) timer register ta0reg (1102h) ta1reg (1103h) ta2reg (110ah) ta3reg (110bh) ta4reg (1112h) ta5reg (1113h) timer mode register ta01mod(1104h) ta23mod(110ch) ta45mod(1114h) sfr (address) timer flip-flop control register ta1ffcr(1105h) ta3ffcr(110dh) ta5ffcr(1115h)
tmp92cy23/cd23a 2009-08-28 92cy23-129 3.7.1 block diagrams figure 3.7.1 tmra01 block diagram t1 t16 t256 8-bit comparator (cp1) 8-bit comparator (cp0) 8-bit up counter (uc0) 2 n over flow 8-bit up counter (uc1) timer flip-flop ta1ff match detect match detect 8-bit timer register ta1reg t1 t4 t16 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 run/clea r prescale r ta01mod prescale r clock: t0 ta01run selecto r 8-bit timer register ta0reg ta01mod ta01mod tmra0 interrupt output: intta0 tmra0 interrupt output: ta0trg ta01mod ta01run ta1ffcr timer flip-flop output: ta1out tmra1 interrupt output: intta1 internaldata bus ta01run ta01run selecto r internal data bus t a 0trg register buffer 0 external input clock: ta0in
tmp92cy23/cd23a 2009-08-28 92cy23-130 figure 3.7.2 tmra23 block diagram t1 t16 t256 8-bit comparator (cp3) 8-bit comparator (cp2) 8-bit up counter (uc2) 2 n over flow 8-bit up comparator (uc3) timer flip-flop ta3ff match detect match detect 8-bit timer register ta3reg t1 t4 t16 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 run/clea r prescale r ta23mod prescale r clock: t0 ta23run selecto r 8-bit timer register ta2reg ta23mod ta23mod tmra2 interrupt output: intta2 tmra2 interrupt output: ta2trg ta23mod ta23run ta3ffcr timer flip-flop output: ta3out tmra3 interrupt output: intta3 internal data bus ta23run ta23run selecto r internal data bus ta2trg register buffer 2
tmp92cy23/cd23a 2009-08-28 92cy23-131 figure 3.7.3 tmra45 block diagram t1 t16 t256 8-bit comparator (cp5) 8-bit comparator (cp4) 8-bit up counter (uc4) 2 n over- flow 8-bit up counter (uc5) timer flip-flop ta5ff match detect match detect 8-bit timer register ta5reg t1 t4 t16 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 run/clea r prescale r ta45mod prescale r clock: t0 ta45run selecto r 8-bit timer register ta4reg ta45mod ta45mod tmra4 interrupt output: intta4 tmra4 match output: ta4trg ta45mod ta45run ta5ffcr timer flip-flop output: ta5out tmra5 interrupt outptu: intta5 internal data bus ta45run ta45run selecto r internal data bus ta4trg register buffer 4
tmp92cy23/cd23a 2009-08-28 92cy23-132 3.7.2 operation of each circuit (1) prescalers a 9-bit prescaler generates the input clock to tmra01. the prescaler clock ( t0) is a divided clock (divided by 4) from the f fph. the prescaler?s operation can be controlled using ta01run in the timer control register. setting to ?1? starts the count; setting to ?0? clears the prescaler to ?0? and stops operation. table 3.7.2 shows the v ari ous p rescaler output clock resolutions. table 3.7.2 prescaler output clock resolution timer counter input clock tmra prescaler taxmod clock value syscr1 system clock syscr1 ? t1(1/2) t4(1/8) t16(1/32) t256(1/512) ? 1 (fs) fs/8 fs/32 fs/128 fs/2048 000 (1/1) fc/8 fc/32 fc/128 fc/2048 001 (1/2) fc/16 fc/64 fc/256 fc/4096 010 (1/4) fc/32 fc/128 fc/512 fc/8192 011 (1/8) fc/64 fc/256 fc/1024 fc/16384 100 (1/16) 0 (fc) 1/4 fc/128 fc/512 fc/2048 fc/32768 (2) up counters (uc0 and uc1) these are 8-bit binary counters which count up the input clock pulses for the clock specified by ta01mod. the input clock for uc0 is selectable and ca n be either the external clock input via the ta0in pin or one of the three internal clocks t1, t4 or t16. the clock setting is specified by the value set in ta01mod. the input clock for uc1 depends on the operation mode. in 16-bit timer mode, the overflow output from uc0 is used as the input clock. in any mode other than 16-bit timer mode, the input clock is selectable and can either be one of the internal clocks t1, t16 or t256, or the comparator output (the match detection signal) from tmra0. for each interval timer the timer operation control register bits ta01run and ta01run can be used to stop and clear the up counters and to control their count. a reset clears both up counters, stopping the timers.
tmp92cy23/cd23a 2009-08-28 92cy23-133 (3) timer registers (ta0reg and ta1reg) these are 8-bit registers, which can be used to set a time interval. when the value set in the timer register ta0reg or ta1reg matches the value in the corresponding up counter, the comparator match detect signal goes active. if the value set in the timer register is 00h, the signal goes active when the up counter overflows. the ta0reg has a double buffer structure, making a pair with the register buffer. the setting of the bit ta01run determines whether ta0reg?s double buffer structure is enabled or disabled. it is disabled if = ?0? and enabled if = ?1?. when the double buffer is enabled, data is transferred from the register buffer to the timer register when a 2 n overflow occurs in pwm mode, or at the start of the ppg cycle in ppg mode. hence the double buffer cannot be used in timer mode. a reset initializes to ?0?, disabling the double buffer. to use the double buffer, write data to the timer register 0, set to ?1?, and write the following data to the re gister buffer. figure 3.7.4 show the configuration of ta0reg. figure 3.7.4 config uration of t a0reg note: the same memory address is allocated to the timer register and the register buffer. when = ?0?, the same value is written to the register buffer and the timer register; when = ?1?, only the register buffer is written to. the address of each timer register is as follows. ta0reg: 001102h ta1reg: 001103h ta2reg: 00110ah ta3reg: 00110bh ta4reg: 001112h ta5reg: 001113h all these registers are write only and cannot be read. internal data bus ta01run timer register a0 (ta0reg) register buffer 0 shift trigger b selector sa write write to ta0reg match detecting ppg cycle pwm 2 n overflow
tmp92cy23/cd23a 2009-08-28 92cy23-134 (4) comparator (cp0, cp1) the comparator compares the value in an up counter with the value set in a timer register. if they match, the up counter is cleared to ?0? and an interrupt signal (intta0 or intta1) is generated. if timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time. (5) timer flip-flop (ta1ff) the timer flip-flop (ta1ff) is a flip-flop inverted by the match detect signals (8-bit comparator output) of each interval timer. whether inversion is enabled or disabled is determined by the setting of the bit ta1ffcr in the timer flip-flops co ntrol register a reset clears the value of ta1ff to ?0?. writing ?01? or ?10? to ta1 ffcr sets ta1ff to ?0? or ?1?. writing ?00? to these bits inverts the value of ta1ff (this is known as software inversion). the ta1ff signal is output via the ta1out pin (which can also be used as p80). when this pin is used as the timer output, the timer flip-flop should be set beforehand using the port 8 function register p8cr and p8fc.
tmp92cy23/cd23a 2009-08-28 92cy23-135 3.7.3 sfr tmra01 run register 7 6 5 4 3 2 1 0 bit symbol ta0rde i2ta01 ta01prun ta1run ta0run ta01run (1100h) read/write r/w r/w reset state 0 0 0 0 0 tmra01 prescaler up counter (uc1) up counter (uc0) function double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the values of bits 4 to 6 of ta01run are read as undefined values. tmra23 run register 7 6 5 4 3 2 1 0 bit symbol ta2rde i2ta23 ta23prun ta3run ta2run ta23run (1108h) read/write r/w r/w reset state 0 0 0 0 0 tmra23 prescaler up counter (uc3) up counter (uc2) function double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the values of bits 4 to 6 of ta23run are read as undefined values. figure 3.7.5 register for tmra timer run/stop control 0 stop and clear 1 run (count up) ta0reg double buffer control 0 disable 1 enable timer run/stop control 0 stop and clear 1 run (count up) ta2reg double buffer control 0 disable 1 enable
tmp92cy23/cd23a 2009-08-28 92cy23-136 tmra45 run register 7 6 5 4 3 2 1 0 bit symbol ta4rde i2ta45 ta45prun ta5run ta4run ta45run (1110h) read/write r/w r/w reset state 0 0 0 0 0 tmra45 prescaler up counter (uc5) up counter (uc4) function double buffer 0: disable 1: enable idle4 0: stop 1: operate 0: stop and clear 1: run (count up) note: the values of bits 4 to 6 of ta45run are read as undefined values. figure 3.7.6 register for tmra timer run/stop control 0 stop and clear 1 run (count up) ta4reg double buffer control 0 disable 1 enable
tmp92cy23/cd23a 2009-08-28 92cy23-137 tmra01 mode register 7 6 5 4 3 2 1 0 bit symbol ta01m1 ta01m0 pwm01 pwm 00 ta1clk1 ta1clk0 ta0clk1 ta0clk0 ta01mod (1104h) read/write r/w reset state 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra1 00: ta0trg 01: t1 10: t16 11: t256 source clock for tmra0 00: ta0in pin input (note) 01: t1 10: t4 11: t16 00 ta0in (external input) 01 t1 10 t4 11 t16 ta01mod ?01? ta01mod = ?01? 00 matching output for tmra0 01 t1 10 t16 11 t256 overflow output from tmra0 (16-bit timer mode) 00 reserved 01 2 6 source clock 10 2 7 source clock 11 2 8 source clock 00 8-bit timer 2ch 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (tmra0), 8-bit timer (tmra1) note: when setting ta0in, set ta01mod after set port c0. figure 3.7.7 register for tmra pwm cycle selection tmra1 input clock tmra01 operation mode selection tmra0 input clock
tmp92cy23/cd23a 2009-08-28 92cy23-138 tmra23 mode register 7 6 5 4 3 2 1 0 bit symbol ta23m1 ta23m0 pwm21 pwm 20 ta3clk1 ta3clk0 ta2clk1 ta2clk0 ta23mod (110ch) read/write r/w reset state 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra3 00: ta2trg 01: t1 10: t16 11: t256 source clock for tmra2 00: reserved 01: t1 10: t4 11: t16 00 reserved 01 t1 10 t4 11 t16 ta23mod ?01? ta23mod = ?01? 00 matching output for tmra2 01 t1 10 t16 11 t256 overflow output from tmra2 (16-bit timer mode) 00 reserved 01 2 6 source clock 10 2 7 source clock 11 2 8 source clock 00 8-bit timer 2ch 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (tmra2), 8-bit timer (tmra3) figure 3.7.8 register for tmra pwm cycle selection tmra3 input clock tmra23 operation mode selection tmra2 input clock
tmp92cy23/cd23a 2009-08-28 92cy23-139 tmra45 mode register 7 6 5 4 3 2 1 0 bit symbol ta45m1 ta45m0 pwm41 pwm 40 ta5clk1 ta5clk0 ta4clk1 ta4clk0 ta45mod (1114h) read/write r/w reset state 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra5 00: ta4trg 01: t1 10: t16 11: t256 source clock for tmra4 00: reserved 01: t1 10: t4 11: t16 00 reserved 01 t1 10 t4 11 t16 ta45mod ?01? ta45mod = ?01? 00 matching output for tmra4 01 t1 10 t16 11 t256 overflow output from tmra4 (16-bit timer mode) 00 reserved 01 2 6 source clock 10 2 7 source clock 11 2 8 source clock 00 8-bit timer 2ch 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (tmra4), 8-bit timer (tmra5) figure 3.7.9 register for tmra pwm cycle selection tmra5 input clock tmra45 operation mode selection tmra4 input clock
tmp92cy23/cd23a 2009-08-28 92cy23-140 tmra1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta1ffc1 ta1ffc0 ta1ffie ta1ffis ta1ffcr (1105h) read/write r/w reset state 1 1 0 0 a read-modify -write operation cannot be performed. function 00: invert ta1ff 01: set ta1ff 10: clear ta1ff 11: don?t care ta1ff control for inversion 0: disable 1: enable ta1ff inversion select 0: tmra0 1: tmra1 0 inversion by tmra0 ta1ffis 1 inversion by tmra1 0 disabled ta1ffie 1 enabled 00 inverts the value of ta1ff (software inversion) 01 sets ta1ff to ?1? 10 clears ta1ff to ?0? 11 don?t care note: the values of bits4 to 6 of ta1ffcr are read as undefined values. figure 3.7.10 register for tmra control of ta1ff inversion signal for timer flip-flop 1 (ta1ff) (don?t care except in 8-bit timer mode) inversion of ta1ff
tmp92cy23/cd23a 2009-08-28 92cy23-141 tmra3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta3ffc1 ta3ffc0 ta3ffie ta3ffis ta3ffcr (110dh) read/write r/w reset state 1 1 0 0 a read-modify -write operation cannot be performed function 00: invert ta3ff 01: set ta3ff 10: clear ta3ff 11: don?t care ta3ff control for inversion 0: disable 1: enable ta3ff inversion select 0: tmra2 1: tmra3 0 inversion by tmra2 ta3ffis 1 inversion by tmra3 0 disabled ta3ffie 1 enabled 00 inverts the value of ta3ff (software inversion) 01 sets ta3ff to ?1? 10 clears ta3ff to ?0? 11 don?t care note: the values of bits4 to 6 of ta3ffcr are read as undefined values. figure 3.7.11 register for tmra control of ta3ff inversion signal for timer flip-flop 3 (ta3ff) (don?t care except in 8-bit timer mode) inversion of ta3ff
tmp92cy23/cd23a 2009-08-28 92cy23-142 tmra5 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta5ffc1 ta5ffc0 ta5ffie ta5ffis ta5ffcr (1115h) read/write r/w reset state 1 1 0 0 a read-modify -write operation cannot be performed function 00: invert ta5ff 01: set ta5ff 10: clear ta5ff 11: don?t care ta5ff control for inversion 0: disable 1: enable ta5ff inversion select 0: tmra4 1: tmra5 0 inversion by tmra4 ta5ffis 1 inversion by tmra5 0 disabled ta5ffie 1 enabled 00 inverts the value of ta5ff (software inversion) 01 sets ta5ff to ?1? 10 clears ta5ff to ?0? 11 don?t care note: the values of bits4 to 6 of ta5ffcr are read as undefined values. figure 3.7.12 register for tmra control of ta5ff inversion signal for timer flip-flop 5 (ta5ff) (don?t care except in 8-bit timer mode) inversion of ta5ff
tmp92cy23/cd23a 2009-08-28 92cy23-143 tmra register 7 6 5 4 3 2 1 0 bit symbol ? read/write w ta0reg (1102h) reset state undefined bit symbol ? read/write w ta1reg (1103h) reset state undefined bit symbol ? read/write w ta2reg (110ah) reset state undefined bit symbol ? read/write w ta3reg (110bh) reset state undefined bit symbol ? read/write w ta4reg (1112h) reset state undefined bit symbol ? read/write w ta5reg (1113h) reset state undefined note: a read-modify -write operation cannot be performed. figure 3.7.13 register for tmra
tmp92cy23/cd23a 2009-08-28 92cy23-144 3.7.4 operation in each mode (1) 8-bit timer mode both tmra0 and tmra1 can be used indepe ndently as 8-bit interval timers. when set function and count data, tmra0 and tmra1 should be stopped. 1. generating interrupts at a fixed interval (using tmra1) to generate interrupts at constant intervals using tmra1 (intta1), first stop tmra1 then set the operation mode, input clock and a cycle to ta01mod and ta1reg register, respectively. then, enable the interrupt intta1 and start tmra1 counting. example: to generate an intta1 interrupt every 40 s at f c = 40 mhz, set each register as follows: *clock state: clock gear : 1/1(fc) msb lsb 7 6 5 4 3 2 1 0 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to ?0?. ta01mod 0 0 x x 0 1 ? ? select 8-bit timer mode and select t1 ( = (8/fc)s at f c = 40 mhz) as the input clock. ta1reg 1 1 0 0 1 0 0 0 set 40 s t1 = 200 = c8h to tareg. inteta01 x 1 0 1 ? ? ? ? enable intta1 and set it to level 5. ta01run ? x x x ? 11 ? start tmra1 counting. x: don?t care, ? : no change select the input clock using table 3.7.3. t able 3.7.3 selecting interrupt interval a nd the input clock using 8-bit timer input clock interrupt interval (at f c = 40 mhz) resolution t1 (8/fc) 0.2 s to 51.2 s 0.2 s t4 (32/fc) 0.8 s to 204.8 s 0.8 s t16 (128/fc) 3.2 s to 819.2 s 3.2 s t256 (2048/fc) 51.2 s to 13.11 ms 51.2 s note: the input clocks for tmra0 and tmra1 differ as follows: tmra0: uses tmra0 input (ta0in) and can be selected from t1, t4 or t16 tmra1: matches output of tmra0 (ta0trg) and can be selected from t1, t16, t256
tmp92cy23/cd23a 2009-08-28 92cy23-145 2. generating a 50 % duty ratio square wave pulse the state of the timer flip-flop (ta1ff) is inverted at constant intervals and its status output via the timer output pin (ta1out). example: to output a 1.2- s square wave pulse from the ta1out pin at f c = 40 mhz, use the following procedure to make the appropriate register settings. this example uses tmra1; however, either tmra0 or tmra1 may be used. *clock state: clock gear : 1/1(fc) 7 6 5 4 3 2 1 0 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to ?0?. ta01mod 0 0 x x 0 1 ? ? select 8-bit timer mode and select t1 ( = (8/fc)s at f c = 40 mhz) as the input clock. ta1reg 0 0 0 0 0 0 1 1 set the timer register to 1.2 s t1 2 = 3 ta1ffcr x x x x 1 0 1 1 clear ta1ff to ?0? and set it to invert on the match detect signal from tmra1. p8fc x x x x ? x ? 1 set p80 to function as the ta1out pin. ta01run ? x x x ? 11 ? start tmra1 counting. x: don?t care, ? : no change figure 3.7.14 square wave output timing chart (50 % duty) 0 1 2 3 0 1 2 3 0 1 2 3 0 t1 ta01run bit7 to bit2 bit1 bit0 up counter comparato r timing 0.6 s at f c = 40 mhz intta1 ta1ff ta1out comparator output (match detect) uc1 clea r
tmp92cy23/cd23a 2009-08-28 92cy23-146 3. making tmra1 count up on the match signal from the tmra0 comparator select 8-bit timer mode and set the comparator output from tmra0 to be the input clock to tmra1. figure 3.7.15 tmra1 count up on signal from tmra0 (2) 16-bit timer mode a 16-bit interval timer is configured by pairing the two 8-bit timers tmra0 and tmra1. to make a 16-bit interval timer in which tmra0 and tmra1 are cascaded together, set ta01mod to ?01?. in 16-bit timer mode, the overflow output from tmra0 is used as the input clock for tmra1, regardless of the value set in ta01mod. table 3.7.2 shows the re lati ons hip between the timer (interrupt) cycle and the input clock selection. to set the timer interrupt interval, set the lower eight bits in timer register ta0reg and the upper eight bits in ta1reg. be sure to set ta0reg first (as entering data in ta0reg temporarily disables the compare, while entering data in ta1reg starts the compare). setting example: to generate an intta1 interrupt every 0.2 s at f c = 40 mhz, set the timer registers ta0reg and ta1reg as follows: *clock state: clock gear : 1/1(fc) if t16 ( = (128/fc)s at f c = 40 mhz) is used as the input clock for counting, set the following value in the registers: 0.2 s (128/fc)s = 62500 = f424h; e.g. set ta1reg to f4h and ta0reg to 24h. 2 345 1 234 5 12 3 1 1 2 1 comparator output (tmra0 match) tmra0 up counter (when ta0reg = 5) tmra1 up counter (when ta1reg = 2) tmra1 match out p ut
tmp92cy23/cd23a 2009-08-28 92cy23-147 the comparator match signal is output from tmra0 each time the up counter uc0 matches ta0reg, though the up counter uc0 is not cleared. in the case of the tmra1 comparator, the match detect signal is output on each comparator pulse on which the values in the up counter uc1 and ta1reg match. when the match detect signal is output simultaneously from both the comparator tmra0 and tmra1, the up counters uc0 and uc1 are cleared to ?0? and the interrupt intta1 is generated. also, if inversion is enabled, the value of the timer flip-flop ta1ff is inverted. example: when ta1reg = 04h and ta0reg = 80h figure 3.7.16 timer output by 16-bit timer mode (3) 8-bit ppg (programmable pulse generation) output mode square wave pulses can be generated at any frequency and duty ratio by tmra0. the output pulses may be active low or active high. in this mode tmra1 cannot be used. tmra0 outputs pulses on the ta1out pin (which can also be used as p80). figure 3.7.17 8-bit ppg output waveforms inversion value of up counte r (uc1, uc0) tmra0 comparator match detect signal interru p t intta1 0080h 0180h 0280h 0380h 0480h timer out p ut ta1out tmra1 comparator match detect signal interru p t intta0 0080h t ta0reg ta1reg example: = ?01? ta0reg and uc0 match (interrupt intta0) ta1reg and uc0 match ( interru p t intta1 ) ta1out t h t l = ?10? t t l t h = ?01?
tmp92cy23/cd23a 2009-08-28 92cy23-148 in this mode a programmable square wave is generated by inverting the timer output each time the 8-bit up counter (uc0) matches the value in one of the timer registers ta0reg or ta1reg. the value set in ta0reg must be smaller than the value set in ta1reg. although the up counter for tmra1 (uc1) is not used in this mode, ta01run should be set to ?1? so that uc1 is set for counting. figure 3.7.18 shows a block diagram representing this mode. figure 3.7.18 block diag ra m of 8-bit ppg output mode if the ta0reg double buffer is enabled in this mode, the value of the register buffer will be shifted into ta0reg each time ta1reg matches uc0. use of the double buffer facilitates the handling of low duty waves (when duty is varied). figure 3.7.19 operation of register buffer 0 q 2 q 1 match with ta0reg and up counter match with ta1reg q 3 q 2 (up counter = q 1 ) (up counter = q 2 ) shift from register buffer 0 ta0reg (register buffer 0) write ta0reg (value to be compared) register buffe r 8-bit up counter (uc0) comparator comparator ta0in t1 t4 t16 ta01mod ta1ff ta0reg register buffer 0 ta1reg ta01run ta0reg-wr ta01run ta1out ta1ffcr intta0 intta1 shift trigge r internal data bus selecto r inversion selecto r
tmp92cy23/cd23a 2009-08-28 92cy23-149 example: to generate 1/4 duty 62.5 khz pulses (at f c = 40 mhz) *clock state: clock gear : 1/1(fc) calculate the value that should be set in the timer register. to obtain a frequency of 62.5 khz, the pulse cycle t should be: t = 1/62.5 khz = 16 s t1 (= (8/fc)s @f c = 40 mhz); 16 s (8/fc)s = 80 therefore set ta1reg = 80 = 50h the duty is to be set to 1/4: t 1/4 = 16 s 1/4 = 4 s 4 s (8/fc)s = 20 therefore, set ta0reg = 20 = 14h 7 6 5 4 3210 ta01run 0 x x x ? 0 0 0 stop tmra0 and tmra1 and clear it to ?0?. ta01mod 1 0 x x x x 0 1 set the 8-bit ppg mode, and select t1 as input clock. ta0reg 0 0 0 1 0100 write 14h. ta1reg 0 1 0 1 0000 write 50h. ta1ffcr x x x x 0 1 1 x set ta1ff, enabling both inversion and the double buffer. 10 generate a negative logic pulse. p8fc2 x x x x ? x ? 1 set p80 as the ta1out pin. ta01run 1 x x x ? 1 1 1 start tmra0 and tmra1 counting. x: don't care, ? : no change 16 s
tmp92cy23/cd23a 2009-08-28 92cy23-150 (4) 8-bit pwm output mode this mode is only valid for tmra0. in this mode, a pwm pulse with the maximum resolution of 8 bits can be output. when tmra0 is used the pwm pulse is output on the ta1out pin (which is also used as p80). tmra1 can also be used as an 8-bit timer. the timer output is inverted when the up counter (uc0) matches the value set in the timer register ta0reg or when 2 n counter overflow occurs (n = 6, 7 or 8 as specified by ta01mod). the up counter uc0 is cleared when 2 n counter overflow occurs. the following conditions must be sa tisfied before this pwm mode can be used. value set in ta0reg < value set for 2 n counter overflow value set in ta0reg ?0? figure 3.7.20 8-bit pwm waveforms figure 3.7.21 shows a block diagram representing this mode. figure 3.7.21 block diag ra m of 8-bit pwm mode ta0reg and uc0 match ta1out t pwm (pwm cycle) 2 n overflow (intta0 interrupt) selector 8-bit up counter (uc0) comparator ta0in t1 t4 t16 ta01mod ta1ff ta0reg register buffer 0 selector ta01run ta0reg-wr ta01run ta1out ta1ffcr shift trigge r internal data bus clear 2 n overflow control intta0 ta01mod overflow inversion
tmp92cy23/cd23a 2009-08-28 92cy23-151 in this mode the value of the register buffer will be shifted into ta0reg if 2 n overflow is detected when the ta0reg double buffer is enabled. use of the double buffer facilitates th e handling of low duty ratio waves. figure 3.7.22 register buffer operation example: to output the following pwm waves on the ta1out pin (at f c = 40 mhz). *clock state: clock gear : 1/1(fc) to achieve a 25.6- s pwm cycle by setting t1 ( = (8/fc)s at f c = 40 mhz): 25.6 s (8/fc)s = 128 = 2 n therefore n should be set to 7. since the low level period is 18.0 s when t1 = (8/fc)s, set the following value for treg0: 18.0 s (8/fc)s = 90 = 5ah msb lsb 7 6 5 4 3210 ta01run ? x x x ? ? ? 0 stop tmra0 and clear it to ?0? ta01mod 1 1 1 0 ? ? 0 1 select 8-bit pwm mode (cycle: 2 7 ) and select t1 as the input clock. ta0reg 0 1 0 1 1010 write 5ah. ta1ffcr x x x x 1 0 1 x clear ta1ff to ?0?, enable the inversion and double buffer. p8fc2 ? ? ? ? ? ? ? 1 set p80 as the ta1out pin. ta01run 1 x x x ? 1 ? 1 start tmra0 counting. x: don't care, ? : no change 18.0 s 25.6 s q 2 q 1 match with ta0reg q 3 q 2 up counter = q 1 up counter = q 2 shift into ta0reg ta0reg (register buffer 0) write ta0reg (value to be compared) re g ister buffe r 2 n overflow
tmp92cy23/cd23a 2009-08-28 92cy23-152 table 3.7.4 pwm cycle pwm cycle taxxmod 2 6 (x64) 2 7 (x128) 2 8 (x256) taxxmod taxxmod taxxmod clock gear value syscr1 system clock syscr0 ? t1(x2) t4(x8) t16(x32) t1(x2) t4(x8) t16(x32) t1(x2) t4(x8) t16(x32) ? 1(fs) 512/fs 2048/fs 8192/fs 1024/fs 4096/ fs 16384/fs 2048/fs 8192/fs 32768/fs 000(x1) 512/fc 2048/fc 8192/fc 1024/fc 4096/ fc 16384/fc 2048/fc 8192/fc 32768/fc 001(x2) 1024/fc 4096/fc 16384/fc 2048/fc 8192/ fc 32768/fc 4096/fc 16384/fc 65536/fc 010(x4) 2048/fc 8192/fc 32768/fc 4096/fc 16384 /fc 65536/fc 8192/fc 32768/fc 131072/fc 011(x8) 4096/fc 16384/fc 65536/fc 8192/fc 32768 /fc 131072/fc 16384/fc 65536/fc 262144/fc 100(x16) 0(fc) 4 8192/fc 32768/fc 131072/fc 16384/fc 65536/fc 262144/fc 32768/fc 131072/fc 524288/fc (5) settings for each mode table 3.7.5 shows the sfr settings for each mode. t able 3.7.5 t i mer mode setting registers register name ta01mod ta1ffcr function timer mode pwm cycle upper timer input clock lower timer input clock timer f/f invert signal select 8-bit timer 2 channels 00 ? lower timer match, t1, t16, t256 (00, 01, 10, 11) external clock, t1, t4, t16 (00, 01, 10, 11) 0: lower timer output 1: upper timer output 16-bit timer mode 01 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit ppg 1 channel 10 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit pwm 1 channel 11 2 6 , 2 7 , 2 8 (01, 10, 11) ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit timer 1 channel 11 ? t1, t16, t256 (01, 10, 11) ? output disabled ? : don?t care
tmp92cy23/cd23a 2009-08-28 92cy23-153 3.8 16-bit timer/event counters (tmrb0) the tmp92cy23/cd23a incorporates two multifunctional 16-bit timer/event counter (tmrb0 and tmrb1) which has the following operation modes: ? 16-bit interval timer ? 16-bit event counter ? 16-bit programmable pulse generation (ppg) can be used following operation modes by capture function. ? frequency measurement mode ? pulse width measurement mode ? time differential measurement mode figure 3.8.1 and figure 3.8.2 show block diag ram of tmrb0 and tmrb1. t he tim e r/event counter consists of a 16-bit up counter, two 16-bit timer registers (one of them with a double buffer structure), two 16-bit capture register, two comparators, a capture input controller, a timer flip -flop and a control circuit. the timer/event counter is controlled by a 11-byte sfr. each channel(tmrb0,tmrb1) operate independently. in this section, the explanation describes only for tmrb1 because each channel is identical operation except for the difference as follows; table 3.8.1 pins and sfr of tmrb channel spec tmrb0 tmrb1 external clock/ caputre triggr input pin none tb1in0 (share with pd1) tb1in1 (share with pd2) external pin timer flip-flop output pin tb0out0 (share with pd0) tb1out0 (share with pd3) tb1out1 (share with pd4) timre run register tb0run (1180h) tb1run (1190h) timrer mode register tb0mod (1182h) tb1mod (1192h) timre flip-flop control register tb0ffcr (1183h) tb1ffcr (1193h) tb0rg0l (1188h) tb1rg0l (1198h) tb0rg0h (1189h) tb1rg0h (1199h) tb0rg1l (118ah) tb1rg1l (119ah) timer register tb0rg1h (118bh) tb1rg1h (119bh) tb0cp0l (118ch) tb1cp0l (119ch) tb0cp0h (118dh) tb1cp0h (119dh) tb0cp1l (118eh) tb1cp1l (119eh) sfr (address) capture register tb0cp1h (118fh) tb1cp1h (119fh)
tmp92cy23/cd23a 2009-08-28 92cy23-154 3.8.1 block diagrams figure 3.8.1 block diagram of tmrb0 internal data bus slelector 16-bit comparator (cp10) tb0mod t1 t4 t16 timer flip-flop control tb0ff0 tb0out0 match detection 16-bit timer register tb0rg0h/l register buffer 10 ta1out tb1mod 16-bit time register tb0rg1h/l tb0mod 16-bit comparator (cp11) capture, external interrupt input control tb0run caputure register 1 tb0cp1h/l capture register 0 tb0cp0h/l run/ clear internal data bus match detection 16-bit up counter (uc10) count clock (from tmra01 ) prescaler clock: t0 32 16 8 4 2 t1 t4 t16 tb0run internal data bus tb0mod intenal data bus overflow interrupt inttbof0 time r flip-flop timer flip-flop output inter r upt output inttb00 inttb01 tb0run
tmp92cy23/cd23a 2009-08-28 92cy23-155 figure 3.8.2 block diagram of tmrb1 internal data bus slelector 16-bit comparator (cp12) tb1mod t1 t4 t16 timer flip-flop control tb1ff0 tb1out0 match detection 16-bit timer register tb1rg0h/l register buffer 12 ta3out tb1in0 tb1in1 tb1mod 16-bit time register tb1rg1h/l tb1mod 16-bit comparator (cp13) capture, external interrupt input control tb1run caputure register 1 tb1cp1h/l capture register 0 tb1cp0h/l run/ clear internal data bus match detection 16-bit up counter (uc12) count clock (from tmra23 ) prescaler clock: t0 32 16 8 4 2 t1 t4 t16 tb1run internal data bus tb1mod intenal data bus overflow interrupt inttbof1 time r flip-flop timer flip-flop output interrupt output inttb10 inttb11 tb1run tb1ff1 tb1out1 external interrupt input int5 int6
tmp92cy23/cd23a 2009-08-28 92cy23-156 3.8.2 operation of each block (1) prescaler the 5-bit prescaler generates the source clock for tmrb1. the prescaler clock ( t0) is a divided clock (divided by 4) from the f fph. this prescaler can be started or stopped using tb1run. counting starts when is set to ?1?; the prescaler is cleared to ?0? and stops operation when is cleared to ?0?. table 3.8.2 prescaler clock resolution timer counter input clock tmrb prescaler tbxmod gear value syscr1 system clock syscr1 ? t1(1/2) t4(1/8) t16(1/32) ? 1 (fs) fs/8 fs/32 fs/128 000 (1/1) fc/8 fc/32 fc/128 001 (1/2) fc/16 fc/64 fc/256 010 (1/4) fc/64 fc/128 fc/512 011 (1/8) fc/64 fc/256 fc/1024 100 (1/16) 0 (fc) 1/4 fc/128 fc/512 fc/2048 (2) up counter (uc12) uc12 is a 16-bit binary counter which counts up pulses input from the clock specified by tb0mod. any one of the prescaler internal clocks t1, t4 and t16 can be selected as the input clock. counting or stopping and clearing of the counter is controlled by tb1run. tmrb0 cannot choose an external clock as an input clock (there is no external clock input terminal). when clearing is enabled, the up counter uc12 will be cleared to 0 each time its value matches the value in the timer register tb1rg1h/l. if clearing is disabled, the counter operates as a free-running counter. clearing can be enable d or disabled using tb1mod. a timer overflow interrupt (inttbof1) is generated when uc12 overflow occurs.
tmp92cy23/cd23a 2009-08-28 92cy23-157 (3) timer registers (tb1rg 0h/l and tb1rg1h/l) these 16-bit registers are used to set the interval time. when the value in the up counter uc12 matches the value set in th is timer register, the comparator match detect signal will go active. setting data for both upper and lower timer registers is always needed. for example, either using a 2-byte data transfer instruction or using a 1-byte data transfer instruction twice for the lower 8 bits and upper 8 bits in order. the tb1rg0h/l timer register has a double-b uffer structure, which is paired with a register buffer. the value set in tb1run determines whether the double-buffer structure is enabled or di sabled: it is disabled when = ?0?, and enabled when = ?1?. when the double buffer is enabled, data is transferred from the register buffer to the timer register when the values in the up counter (uc12) and the timer register tb1rg1h/l match. after a reset, tb1rg0h/l and tb1rg1h/l are undefined. if the 16-bit timer is to be used after a reset, data should be written to it beforehand. on a reset is initialized to ?0?, disabling the double buffer. to use the double buffer, write data to the timer register , set to ?1?, then write data to the register buffer as shown below. tb1rg0h/l and the register buffer both have the same memory addresses (1188h and 1189h) allocated to them. if = ?0?, the value is written to both the timer register and the register buffer. if = ?1?, the value is written to the register buffer only. the addresses of the timer registers are as follows: the timer registers are write-only registers and thus cannot be read. tmrb0 1189h 1188h 118bh 118ah tb0rg0h/l tb0rg1h/l upper 8 bits (tb0rg0h) lower 8 bits (tb0rg0l) upper 8 bits (tb0rg1h) lower 8 bits (tb0rg1l) tmrb1 1199h 1198h 119bh 119ah tb1rg0h/l tb1rg1h/l upper 8 bits (tb1rg0h) lower 8 bits (tb1rg0l) upper 8 bits (tb1rg1h) lower 8 bits (tb1rg1l)
tmp92cy23/cd23a 2009-08-28 92cy23-158 (4) capture registers (tb1cp 0h/l and tb1cp1h/l) these 16-bit registers are used to latch the values in the up counters uc12. all 16 bits of data in the capture registers should be read. for example, using a 2-byte data load instruction or two 1-byte data load instructions twice for lower 8 bits and upper 8 bits in order. the addresses of the capture registers are as follows: the capture registers are read-only r egisters and thus cannot be written to. (5) capture input control this circuit controls the timing to latch the value of the up counter uc12 into tb1cp0h/l and tb1cp1h/l. interrupt timing of capture register and se lection edge of external interrupt are set by tb1mod. (tmrb0 does not include the selection edge of external interrupt.) the value in the up counter can be loaded into a capture register by software. whenever 0 is programmed to tb1mod, the current value in the up counter is loaded into capture register tb1cp0h/l. it is necessary to keep the prescaler in run mode (e.g., tb1run must be held at a value of 1). (6) comparators (cp12, cp13) cp12 is 16-bit comparators which compare the value in the up counter uc12 with the value set in tb1rg0h/l or tb1rg1h/l resp ectively, in order to detect a match. if a match is detected, the comparator generates an interrupt (inttb10 or inttb11 respectively). (7) timer flip-flops (tb1ff0 and tb1ff1) these flip-flops are inverted by the match detect signals from the comparators and the latch signals to the capture registers. inversion can be enabled and disabled for each element using tb1ffcr. after a reset the value of tb1ff0 is undefined. if ?00? is programmed to tb1ffcr or , tb1ff0 will be inverted. if ?01? is programmed to the capture registers, the value of tb1ff0 will be set to ?1?. if ?10? is programmed to the capture registers, the value of tb1ff0 will be cleared to ?0?. the values of tb1ff0 and tb1ff1 can be output via the timer output pin tb1out0 (which is shared with pd3), tb1out1 (which is shard with pd4). the timer output pin of tmrb0 is one pin (tb0out0: which is shard with pd0). timer output should be specified using the port d function register. tmrb0 1189h 1188h 118bh 118ah tb0rg0h/l tb0rg1h/l upper 8 bits (tb0rg0h) lower 8 bits (tb0rg0l) upper 8 bits (tb0rg1h) lower 8 bits (tb0rg1l) tmrb1 1199h 1198h 119bh 119ah tb1rg0h/l tb1rg1h/l upper 8 bits (tb1rg0h) lower 8 bits (tb1rg0l) upper 8 bits (tb1rg1h) lower 8 bits (tb1rg1l)
tmp92cy23/cd23a 2009-08-28 92cy23-159 3.8.3 sfr tmrb0 run register 7 6 5 4 3 2 1 0 bit symbol tb0rde ? i2tb0 tb0prun tb0run tb0run (1180h) read/write r/w r/w r/w reset state 0 0 0 0 0 tmrb0 prescaler up counter (uc10) function double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the 1, 4 and 5 of tb0run are read as undefined values. tmrb1 run register 7 6 5 4 3 2 1 0 bit symbol tb1rde ? i2tb1 tb1prun tb1run tb1run (1190h) read/write r/w r/w r/w reset state 0 0 0 0 0 tmrb1 prescaler up counter (uc12) function double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the 1, 4 and 5 of tb0run are read as undefined values. figure 3.8.3 the r egisters for tmrb count operation 0 stop and clear , 1 count up count operation 0 stop and clear , 1 count up
tmp92cy23/cd23a 2009-08-28 92cy23-160 tmrb0 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0cp0i tb0cpm1 tb0cpm0 tb0cle tb0clk1 tb0clk0 tb0mod (1182h) read/write r/w w * r/w reset state 0 0 1 0 0 0 0 0 a read-modify -write operation cannot be performed. function always write ?0? software capture control 0: software capture 1: undefined capture timing 00: disable 01: reserved 10: reserved 11: ta1out ta1out up counter control 0: disable 1: enable tmrb0 source clock 00: reserved 01: t1 10: t4 11: t16 figure 3.8.4 the r egisters for tmrb0 tmrb0 source clock 00 reserved 01 t1 10 t4 11 t16 control clearing for up counter (uc10) 0 disable 1 enable clearing by match with tb0rg1h/l capture timing capture control 00 disable 01 reserved 10 reserved 11 capture to tb0cp0h/l at rising edge of ta1out capture to tb0cp1h/l at falling edge of ta1out software capture 0 the value of up counter is captured to tb0cp0h/l 1 undefined
tmp92cy23/cd23a 2009-08-28 92cy23-161 tmrb0 mode register 7 6 5 4 3 2 1 0 bit symbol tb1ct1 tb1et1 tb1cp0i t b1cpm1 tb1cpm0 tb1cle tb1clk1 tb1clk0 tb1mod (1192h) read/write r/w w * r/w reset state 0 0 1 0 0 0 0 0 tb1ff1 inversion trigger 0: trigger disable 1: trigger enable a read-modify -write operation cannot be performed function invert when the uc10 value is loaded in to tb1cp1h/l invert when match uc10 with tb1rg1h/l software capture control 0: software capture 1: undefined capture timing 00: disable int5 is rising edge 01: tb1in0 tb1in1 int5 is rising edge 10: tb1in0 tb1in0 int5 is falling edge 11: ta3out ta3out int5 is rising edge up counter clear control 0: disable 1:enable tmrb1 source clock 00: tb1in0 pin input 01: t1 10: t4 11: t16 note:when controlling capture by using tb1mod, control capture after setting syscr2 to ?0?. figure 3.8.5 the r egisters for tmrb0 tmrb1 source clock 00 tb1in0 pin input 01 t1 10 t4 11 t16 control clearing for up counter (uc12) 0 disable 1 enable clearing by match with tb1rg1h/l capture/interrupt timing capture control int5 control 00 disable 01 capture to tb1cp0h/l at rising edge of tb1in0 capture to tb1cp1h/l at rising edge of tb1in1 int5 occurs at the rising edge of tb1in0 10 capture to tb1cp0h/l at rising edge of tb1in0 capture to tb1cp1h/l at falling edge of tb1in0 int5 occurs at the rising edge of tb1in0 11 capture to tb1cp0h/l at rising edge of ta3out capture to tb1cp1h/l at falling edge of ta3out int5 occurs at the rising edge of tb1in0 software capture 0 the value of up counter is captured to tb1cp0h/l 1 undefined tb1ff1 control inverted when uc12 value matches the valued in tb1rg1h/l 0 disable inversion 1 enable inversion tb1ff1 control inverted when uc10 value is captured into tb1cp1h/l 0 disable inversion 1 enable inversion
tmp92cy23/cd23a 2009-08-28 92cy23-162 tmrb0 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0c1t1 tb0c0t1 tb0e1t1 tb0e0t1 tb0ff0c1 tb0ff0c0 tb0ffcr (1183h) read/write w * r/w w * reset state 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: disable trigger 1: enable trigger a read-modify -write operation cannot be performed function always write ?11?. invert when the uc value is loaded into tb0cp1h/l invert when the uc value is loaded into tb0cp0h/l invert when the uc value matches the value in tb0rg1h/l. invert when the uc value matches the value in tb0rg0h/l. control tb0ff0 00: invert 01: set 10: clear 11: don?t care * always read as 11. timer flip-flop control (tb0ff0) 00 invert 01 set to ?11? 10 clear to ?00? 11 don?t care figure 3.8.6 the r egisters for tmrb tb0ff0 control inverted when uc10 value matches the value in tb0rg0h/l 0 disable inversion 1 enable inversion tb0ff0 control inverted when uc10 value matches the value in tb0rg1h/l 0 disable inversion 1 enable inversion tb0ff0 control inverted when uc10 value is captured into tb0cp0h/l 0 disable inversion 1 enable inversion tb0ff0 control inverted when uc10 value is captured into tb0cp1h/l 0 disable inversion 1 enable inversion
tmp92cy23/cd23a 2009-08-28 92cy23-163 tmrb1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol tb1ff1c1 tb1ff1c0 tb1c1t1 tb1c0t1 tb1e1t1 tb1e0t1 tb1ffc1 tb1ffc0 tb1ffcr (1193h) read/write w * r/w w * reset state 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: disable trigger 1: enable trigger a read-modify -write operation cannot be performed. function tb1ff1 control 00: invert 01: set 10: clear 11: don?t care * always read as ?11?. invert when the uc value is loaded into tb1cp1h/l invert when the uc value is loaded into tb1cp0h/l invert when the uc value matches the value in tb1rg1h/l. invert when the uc value matches the value in tb1rg0h/l. control tb1ff0 00: invert 01: set 10: clear 11: don?t care * always read as 11. timer flip-flop control(tb1ff0) 00 invert 01 set to ?11? 10 clear to ?00? 11 don?t care figure 3.8.7 the r egisters for tmrb tb1ff0 control inverted when uc12 value matches the value in tb1rg0h/l 0 disable inversion 1 enable inversion tb1ff0 control inverted when uc12 value matches the value in tb1rg1h/l 0 disable inversion 1 enable inversion tb1ff0 control inverted when uc12 value is captured into tb1cp0h/l 0 disable inversion 1 enable inversion tb1ff0 control inverted when uc12 value is captured into tb1cp1h/l 0 disable inversion 1 enable inversion tb1ff1 control 00 invert value of tb1ff1 01 set tb1ff1 to ?1? 10 set tb1ff1 to ?0? 11 don?t care
tmp92cy23/cd23a 2009-08-28 92cy23-164 tmrb0 register 7 6 5 4 3 2 1 0 bit symbol ? read/write w tb0rg0l (1188h) reset state undefined bit symbol ? read/write w tb0rg0h (1189h) reset state undefined bit symbol ? read/write w tb0rg1l (118ah) reset state undefined bit symbol ? read/write w tb0rg1h (118bh) reset state undefined bit symbol ? read/write w tb1rg0l (1198h) reset state undefined bit symbol ? read/write w tb1rg0h (1199h) reset state undefined bit symbol ? read/write w tb1rg1l (119ah) reset state undefined bit symbol ? read/write w tb1rg1h (119bh) reset state undefined note: a read-modify-write operation cannot be performed. figure 3.8.8 the r egisters for tmrb
tmp92cy23/cd23a 2009-08-28 92cy23-165 capture register 7 6 5 4 3 2 1 0 bit symbol ? read/write r tb0cp0l (118ch) reset state undefined bit symbol ? read/write r tb0cp0h (118dh) reset state undefined bit symbol ? read/write r tb0cp1l (118eh) reset state undefined bit symbol ? read/write r tb0cp1h (118fh) reset state undefined bit symbol ? read/write w tb1cp0l (119ch) reset state undefined bit symbol ? read/write r tb1cp0h (119dh) reset state undefined bit symbol ? read/write r tb1cp1l (119eh) reset state undefined bit symbol ? read/write r tb1cp1h (119fh) reset state undefined note: a read-modify-write operation cannot be performed. figure 3.8.9 the r egisters for tmrb
tmp92cy23/cd23a 2009-08-28 92cy23-166 3.8.4 operation in each mode (1) 16-bit interval timer mode generating interrupts at fixed intervals in th is example, the interval time is set the timer register tb1rg1h/l to ge nerate the interrupt inttb11. 7 6 5 4 3 2 1 0 tb1run 0 0 x x ? 0 x 0 stop tmrb1. intetb1 x 1 0 0 x 0 0 0 enable inttb11 and set interrupt level 4. disable inttb10. tb1ffcr 1 1 0 0 0 0 1 1 disable the trigger. tb1mod 0 0 1 0 0 1 ** select internal clock for input and disable the capture function. ( ** = 01, 10, 11) tb1rg1h/l * * * * * * * * * * * * * * * * set the interval time (16 bits). tb1run 0 0 x x ? 1 x 1 start tmrb1. x : don't care, ?: no change (2) 16-bit event counter mode in 16-bit timer mode as described in above, the timer can be used as an event counter by selecting the external clock (tb1in0 pin input) as the input clock. up counter counting up by rising edge of tb1in0 pin input. and execution software capture and reading capture value enable reading count value. 7 6 5 4 3 2 1 0 tb1run 0 0 x x ? 0 x 0 stop tmrb1. pdcr x x x x ? ? 0 ? pdfc2 x x x x ? ? 0 x set pd1 to tb1in0 input mode. pdfc x x x x ? ? 1 ? intetb1 x 1 0 0 x 0 0 0 set inttb11 to enable (interrupt level4). set inttb10 to disable. tb1ffcr 1 1 0 0 0 0 1 1 set trigger to disable. tb1mod 0 0 1 0 0 1 0 0 set input clock to tb1in0 pin input. tb1rg1h/l * * * * * * * * * * * * * * * * set number of count. (16 bits) tb1run 0 0 x x ? 1 x 1 start tmrb1. x: don?t care, ? : no change note: when used as an event counter, set the prescaler to ?run? (tb1run = ?1?).
tmp92cy23/cd23a 2009-08-28 92cy23-167 (3) 16-bit programmable pulse generation (ppg) output mode square wave pulses can be generated at any frequency and duty ratio. the output pulse may be either low active or high active. the ppg mode is obtained by inversion of the timer flip-flop tb1ff0 that is enabled by the match of the up counter uc12 with timer register tb1rg0h/l or tb1rg1h/l and is output to tb1out0. in this mode th e following conditions must be satisfied. (value set in tb1rg0h/l) < (value set in tb1rg1h/l) figure 3.8.10 programmable pulse generation (ppg) output waveforms when the tb1rg0h/l double buffer is enabled in this mode, the value of register buffer 12 will be shifted into tb1rg0h/l at match with tb1rg1h/l. this feature facilitates the handling of low duty waves. figure 3.8.11 operation of register buffer match with tb1rg0h/l (inttb10 inerrupt) match with tb1rg1h/l (inttb11 interrupt) tb1out0 p in q 2 q 1 match with tb1rg0h/l q 3 q 2 up counter = q 1 up counter = q 2 shift into tb1rg0h/l tb1rg0h/l ( com p are value ) register buffer 12 match with tb1rg1h/l write tb1rg0h/l
tmp92cy23/cd23a 2009-08-28 92cy23-168 the following block diagram illustrates this mode. figure 3.8.12 block diagram of 16-bit mode the following example shows how to set 16-bit ppg output mode: 7 6 5 4 3 2 1 0 tb1run 0 0 x x ? 0 x 0 disable the tb1rg0h/l double buffer and stop tmrb0. * * * * * * * * tb1rg0h/l * * * * * * * * set the duty ratio (16 bits). * * * * * * * * tb1rg1h/l * * * * * * * * set the frequency (16 bits). tb1run 1 0 x x ? 0 x 0 enable the tb1rg0h/l double buffer. (the duty and frequency are changed on an inttb11 interrupt.) tb1ffcr 1 1 0 0 1 1 1 0 set the mode to invert tb0ff0 at the match with tb1rg0h/l, tb1rg1h/l. clear tb1ff0h/l to ?0?. tb1mod 0 0 1 0 0 1 ** select the internal clock as the input clock and disable ( ** = 01, 10, 11) the capture function. pdfc2 x x x ? 0 ? ? x pdfc x x x ? 1 ? ? ? pdcr x x x ? 1 ? x ? set pd3 to function as tb1out0. tb1run 1 0 x x ? 1x1 start tmrb1. x : don't care, ?: no change selecto r 16-bit up counter uc12 16-bit comparator 16-bit comparator tb1in0 t1 t4 t16 f/f (tb1ff0) tb1rg0h/l register buffer 12 tb1rg1h/l tb1run tb1rg0h/l-wr tb1run tb1out0 (ppg output) internal data bus clear match selecto r
tmp92cy23/cd23a 2009-08-28 92cy23-169 (4) capture function examples used capture function, they can be applicable in many ways, for example: 1. one-shot pulse output from external trigger pulse 2. frequency measurement 3. pulse width measurement 4. measurement of difference time 1. one-shot pulse output from external trigger pulse set the up counter uc12 in free-running mode with the internal input clock, input the external trigger pulse from tb1in0 pin, and load the value of up counter into capture register tb1cp0h/l at the rise edge of external trigger pulse. when the interrupt int5 is generated at the rise edge of external trigger pulse, set the tb1cp0h/l value (c) plus a delay time (d) to tb1rg0h/l ( = c + d), and set the above set value (c + d) plus a one-shot width (p) to tb1rg1h/l ( = c + d + p). and, set ?11? to timer flip-flop contro l register tb1ffcr. set to trigger enable for be inverted time r flip-flop tb1ff0 by uc0 matching with tb1rg0h/l and with tb1rg1h/l. when interrupt inttb11 occurs, this inversion will be disabled after one-shot pulse is output. the (c), (d), and (p) correspond to c, d, and p in figure 3.8.13. figure 3.8.13 one-shot pulse ou tput (with delay ) tb1in0 pin input ( external tri gg er p ulse ) c c + d + p load into capture register (tb1cp0h/l) and generate int5. match with tb1rg1h/l timer ou p ut p in tb1out0 delay time d match with tb1rg0h/l c + d pulse width p inversion enable set it to disables that inversion caused by loading into tb1cp0h/l. inversion enable generate inttb11. count clock ( internal clock ) set the counter in free-running mode.
tmp92cy23/cd23a 2009-08-28 92cy23-170 example: to output a 2 [ms] one-sh ot pulse with a 3 [ms] delay to the external trigger pulse via the tb1in0 pin. * clock state system clock: high frequency (fc) high speed clock gear: 1/1 (fc) setting in main set free running. count using t1. tb1mod x x 1 0 1 001 load into tb1cp0 by rising edge of tb1in0 pin input. tb1ffcr x x 0 0 0 010 clear tb1ff0 to ?0?. disable inversion of tb1ff0. pdcr x x x ? 1 ? x ? pdfc x x x ? 1 ? ? ? pdfc2 x x x ? 0 ? ? x set pd3 to function as the tb1out0 pin. inte45 x 1 0 0 x ? ? ? intetb1 x 0 0 0 x 000 enable int5. disable inttb10 and inttb11. tb1run ? 0 x x ? 1x1 start tmrb1. setting in int5 tb1rg0h/l tb1cp0h/l + 3 ms/ t1 tb1rg1h/l tb1rg0h/l + 2 ms/ t1 tb1ffcr x x ? ? 1 1 ? ? enable inversion of tb1ff0 when match with tb1rg0h/l or tb1rg1h/l. intetb1 x 1 0 0 x ? ? ? set inttb11 to enable. setting in inttb11 tb1ffcr x x ? ? 0 0 ? ? disable inversion of tb1ff0 when match with tb1rg0h/l or tb1rg1h/l. intetb1 x 0 0 0 x ? ? ? disable inttb11. x : don?t care, ?? : no change when delay time is unnecessary, invert timer flip-flop tb1ff0 when up counter value is loaded into capture register (tb1cp0h/l), and set the tb1cp0h/l value (c) plus the one-shot pulse width (p) to tb0rg1h/l when the interrupt int5 occurs. the tb1ff0 inversion should be en able when the up counter (uc12) value matches tb1rg1h/l, and disabled when generating the interrupt inttb11.
tmp92cy23/cd23a 2009-08-28 92cy23-171 figure 3.8.14 one-shot pulse output (without delay) 2. frequency measurement the frequency of the external clock can be measured in this mode. frequency is measured by the 8-bit timers tmra23 and the 16-bit timer/event counter. tmra23 is used to setting of meas urement time by inversion ta3ff. counter clock in tmrb1 select tb1in0 pin input, and count by external clock input. set to tb1mod = ?11?. the value of the up counter (uc12) is loaded into the capture register tb1cp0h/l at the rise edge of the timer flip-flop ta3ff of 8-bit timers (tmra23), and into tb0cp1h/l at its fall edge. the frequency is calculated by difference between the loaded values in tb1cp0h/l and tb1cp1h/l when the interrupt (intta2 or intta3) is generates by either 8-bit timer. figure 3.8.15 frequency measurement for example, if the value for the level 1 width of ta3ff of the 8-bit timer is set to 0.5 s and the difference between the values in tb1cp0h/l and tb1cp1h/l is 100, the frequency is 100 0.5 s = 200 hz. tb1in0 input (external trigger pulse) c load into capture register tb1cp0h/l and generate int5. match with tb1rg1h/l timer out p ut tb1out0 p in c + p pulse width (p) inversion enable count clock (prescaler output clock) generate inttb11. load into capture register 1 tb1cp1h/l. set it to disable that inversion caused by loading into tb1cp1h/l. set it to enable that inversion caused by loading into tb1cp0h/l. c1 c2 c1 c2 c2 c1 ta3ff load into tb1cp0h/l count clock (tb1in0 pin input ) load into tb1cp1h/l intta2/intta3
tmp92cy23/cd23a 2009-08-28 92cy23-172 3. pulse width measurement this mode allows measuring the high level width of an external pulse. while keeping the 16-bit timer/event counter counting (free running) with the prescaler output clock input, external pulse is input through the tb1in0 pin. then the capture function is used to load the uc12 values into tb1cp0h/l and tb1cp1h/l at the rising edge and falling edge of the external trigger pulse respectively. the interrupt int5 occurs at the falling edge of tb1in0. the pulse width is obtained from the difference between the values of tb1cp0h/l and tb1cp1h/l and the internal clock cycle. for example, if the prescaler output clock is 0.8 s and the difference between tb1cp0h/l and tb1cp1h/l is 100, the pulse width will be 100 0.8 s = 80 s. additionally, the pulse width that is over the uc12 maximum count time specified by the clock source can be measured by changing software. figure 3.8.16 pulse width measurement note: pulse width measure by setting ?10? to tb1mod. the external interrupt int5 is generated in timing of falling edge of tb1in0 input. in other modes, it is generated in timing of rising edge of tb1in0 input. the width of low level can be measured from the difference between the first c2 and the second c1 at the second int5 interrupt. c1 c2 c1 c2 c2 c1 tb1in0 pin input (external pulse) load into tb1cp0h/l prescaler output clock load into tb1cp1h/l int5
tmp92cy23/cd23a 2009-08-28 92cy23-173 4. measurement of difference time this mode is used to measure the difference in time between the rising edges of external pulses input through tb1in0 and tb1in1. keep the 16-bit timer/event counter (tmrb1) counting (free running) with the prescaler output clock, and load the uc12 value into tb1cp0h/l at the rising edge of the input pulse to tb1in0. then the interrupt int5 is generated. similarly, the uc12 value is loaded into tb1cp1h/l at the rising edge of the input pulse to tb1in1, generating the interrupt int6. the time difference between these pulses can be obtained by multiplying the value subtracted tb1cp0h/l from tb1c p1h/l and the internal clock cycle together at which loading the uc12 value into tb1cp0h/l and tb1cp1h/l has been done. figure 3.8.17 measurement of difference time c1 c2 tb1in0 p in in p ut load intotb1cp1h/l prescaler output clock int5 int6 difference time load into tb1cp0h/l tb1in1 p in in p ut
tmp92cy23/cd23a 2009-08-28 92cy23-174 3.9 serial channels the tmp92cy23/cd23a includes 3 serial i/o ch annels. each channel is called sio0, sio1 and sio2. for each channel either uart mode (asynchronous transmission) or i/o interface mode (synchronous transmission) can be selected. i/o interface mode mode 0: for transm itting and receiving i/o data using the synchronizing signal sclk for extending i/o. uart mode mode 1: 7-bit data mode 2: 8-bit data mode 3: 9-bit data in mode 1 and mode 2 a parity bit can be added. mode 3 has a wakeup function for making the master controller start slave controllers via a serial link (a multi controller system). figure 3.9.2, figure 3.9.3 and figure 3.9.4 are block diagrams for each channel. each cha nnel can be used independ ently. each channel operates in the same function except for the following points; hence only the operation of channel 0 is explained below. table 3.9.1 differences between channels 0 to 1 channel 0 channel 1 channel 2 pin name txd0 (pf0) rxd0 (pf1) cts0 /sclk0 (pf2) txd1 (pf3) rxd1 (pf4) cts1 /sclk1 (pf5) txd2 (pd2) rxd2 (pd3) cts2 /sclk2 (pd4) irda mode yes yes yes
tmp92cy23/cd23a 2009-08-28 92cy23-175 figure 3.9.1 data formats bit0 1 2 3 4 5 6 7 bit0 1 2 3 4 5 6 stop start bit0 1 2 3 4 5 parity stop start 6 bit0 1 2 3 4 5 7 stop start bit0 1 2 3 4 5 parity stop start 7 6 6 bit0 1 2 3 4 5 8 stop start bit0 1 2 3 4 5 stop start bit8 6 6 7 7 transfer direction ? mode 0 (i/o interface mode) ? mode 1 (7-bit uart mode) no parity parity no parity parity ? mode 2 (8-bit uart mode) ? mode 3 (9-bit uart mode) when bit8 = ?1?, address (select code) is denoted. when bit8 = ?0?, data is denoted. wakeup
tmp92cy23/cd23a 2009-08-28 92cy23-176 3.9.1 block diagrams figure 3.9.2 block diagram of serial channel 0 selector t0 t2 t8 t32 sc0mod0 receive buffer 1 (shift register) rxdclk sc0mod0 prescaler selector ta0trg (from tmra0) uart mode br0cr baud rate generator selector sc0mod0 selector 2 i/o interface mode sc0cr receive counter (uart only 16) transmision counter (uart only 16) receive control transmission control intrx0 inttx0 receive buffer 2 (sc0buf) rb8 error flag sc0cr serial channel interrupt control tb8 cts0 (shared with pf2) txd0 (shared with pf0) transmission buffer (sc0buf) rxd0 (shared with pf1) txdclk sc0mod0 f sys sc0mod0 sclk0 output (shared with pf2) sclk0 input (shared with pf2 ) sioclk internal data bus parity control sc0cr serial clock generation circuit br0cr br0add br0cr i/o interface mode t0 2 64 4 8 16 32 prescale r t2 t8 t32 int request
tmp92cy23/cd23a 2009-08-28 92cy23-177 figure 3.9.3 block diagram of serial channel 1 selector t0 t2 t8 t32 sc1mod0 receive buffer 1 (shift register) rxdclk sc1mod0 prescaler selector ta0trg (from tmra0) uart mode br1cr baud rate generator selector sc1mod0 selector 2 i/o interface mode sc1cr receive counter (uart only 16) transmision counter (uart only 16) receive control transmission control intrx1 inttx1 receive buffer 2 (sc1buf) rb8 error flag sc1cr serial channel interrupt control tb8 cts1 (shared with pf5) txd1 (shared with pf3) transmission buffer ( sc1buf ) rxd1 (shared with pf4) txdclk sc1mod0 f sys sc1mod0 sclk1 output (shared with pf5) sclk1 input (shared with pf5) sioclk internal data bus parity control sc1cr serial clock generation circuit br1cr br1add br1cr i/o interface mode t0 2 64 4 8 16 32 prescale r t2 t8 t32 int request
tmp92cy23/cd23a 2009-08-28 92cy23-178 figure 3.9.4 block diagram of serial channel 2 selector t0 t2 t8 t32 sc2mod0 receive buffer 1 (shift register) rxdclk sc2mod0 prescaler selector ta0trg (from tmra0) uart mode br2cr baud rate generator selector sc2mod0 selector 2 i/o interface mode sc2cr receive counter (uart only 16) transmision counter (uart only 16) receive control transmission control intrx2 inttx2 receive buffer 2 (sc2buf) rb8 error flag sc2cr serial channel interrupt control tb8 cts2 (shared with pd4) txd1 (shared with pd2) transmission buffer ( sc2buf ) rxd2 (shared with pd3) txdclk sc2mod0 f sys sc2mod0 sclk2 output (shared with pd4) sclk2 input (shared with pd4) sioclk internal data bus parity control sc2cr serial clock generation circuit br2cr br2add br2cr i/o interface mode t0 2 64 4 8 16 32 prescale r t2 t8 t32 int request
tmp92cy23/cd23a 2009-08-28 92cy23-179 3.9.2 operation for each circuit (1) prescaler there is a 6-bit prescaler for generating a clock to sio0. the prescaler can be run only case of sele cting the baud rate generator as the serial transfer clock. table 3.9.2 shows prescaler clock resolution into the baud rate generator. t able 3.9.2 prescaler clock resolution to baud rate generator clock resolution br0cr system clock syscr1 clock gear syscr1 ? t0 t2(1/4) t8(1/16) t32(1/64) 1(fs) ? fs/4 fs/16 fs/64 fs/256 000(1/1) fc/4 fc/16 fc/64 fc/256 001(1/2) fc/8 fc/32 fc/128 fc/512 010(1/4) fc/16 fc/64 fc/256 fc/1024 011(1/8) fc/32 fc/128 fc/512 fc/2048 0 (fc) 100(1/16) 1/4 fc/64 fc/256 fc/1024 fc/4096 the baud rate generator selects between 4 clock inputs: t0, t2, t8, and t32 among the prescaler outputs.
tmp92cy23/cd23a 2009-08-28 92cy23-180 (2) baud rate generator the baud rate generator is a circuit, whic h generates transmission and receiving clocks that determine the transfer rate of the serial channels. the input clock to the baud rate generator, t0, t2, t8 or t32, is generated by the 6-bit sio prescaler which is shared by the timers. one of these input clocks is selected using the br0cr fiel d in the baud rate generator control register. the baud rate generator includes a frequenc y divider, which divides the frequency by 1 or n + (16 ? k)/16 or 16 values, thereby determining the transfer rate. the transfer rate is determined by th e settings of br0cr and br0add. ? in uart mode (1) when br0cr = ?0? the settings br0add are igno red. the baud rate generator divides the selected prescaler clock by n, which is set in br0ck. (n = 1, 2, 3 ?16) (2) when br0cr = ?1? the n + (16 ? k)/16 division function is enabled. the baud rate generator divides the selected prescaler clock by n + (16 ? k)/16 using the value of n set in br0cr (n = 2, 3?15) and the value of k set in br0add (k = 1, 2, 3?15) note: if n = 1 or n = 16, the n + (16 ? k)/16 division function is disabled. set br0cr to ?0?. ? in i/o interface mode the n + (16 ? k)/16 division function is not available in i/o interface mode. clear br0cr to ?0? before dividing by n. the method for calculating the transfer rate when the baud rate generator is used is explained below. ? in uart mode input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 ? in i/o interface mode input clock of baud rate generator baud rate = frequency divider for baud rate generator 2
tmp92cy23/cd23a 2009-08-28 92cy23-181 ? integer divider (n divider) for example, when the source clock frequency (f c ) is 12.288 mhz, the input clock is t2 (f c /16), the frequency divider n (br0cr) = 5, and br0cr = ?0?, the baud rate in uart mode is as follows: * clock state high speed clock gear : 1/1 (fc) input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 f c /16 = 5 16 = 12.288 10 6 16 5 16 = 9600 (bps) note: the n + (16 ? k)/16 division function is disabled and setting br0add is invalid. ? n + (16 ? k)/16 divider (uart mode only) accordingly, when the source clock frequency (f c ) = 4.8 mhz, the input clock is t0 (f c /4), the frequency divi der n (br0cr) = 3, k (br0add) = 7, and br0cr = ?1?, the baud rate in uart mode is as follows: * clock state high speed clock gear : 1/1 (fc) input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 f c /4 (16 ? 3) = 7 + 16 16 13 = 4.8 10 6 4 (7 + 16 ) 16 = 9600 (bps) table 3.9.3 show examples of uart mode transfer rates. add itionally, the external clock input is available in the serial clock. (serial channels 0, 1 and 2). the method for calculating the baud rate is explained below: ? in uart mode baud rate = external clock input frequency 16 it is necessary to satisfy (external clock input cycle) 4/f c ? in i/o interface mode baud rate = external clock input frequency it is necessary to satisfy (external clock input cycle) 16/f c
tmp92cy23/cd23a 2009-08-28 92cy23-182 table 3.9.3 selection of transfer rate (when baud rate generator is used and br0cr = ?0?) unit (kbps) f c [mhz] input clock frequency divider t0 (f c /4) t2 (f c /16) t8 (f c /64) t32 (f c /256) 9.8304 2 76.800 19.200 4.800 1.200 4 38.400 9.600 2.400 0.600 8 19.200 4.800 1.200 0.300 10 9.600 2.400 0.600 0.150 12.2880 5 38.400 9.600 2.400 0.600 a 19.200 4.800 1.200 0.300 14.7456 2 115.200 28.800 7.200 1.800 3 76.800 19.200 4.800 1.200 6 38.400 9.600 2.400 0.600 c 19.200 4.800 1.200 0.300 19.6608 1 307.200 76.800 19.200 4.800 2 153.600 38.400 9.600 2.400 4 76.800 19.200 4.800 1.200 8 38.400 9.600 2.400 0.600 10 19.200 4.800 1.200 0.300 22.1184 3 115.200 28.800 7.200 1.800 24.5760 1 384.000 96.000 24.000 6.000 2 192.000 48.000 12.000 3.000 4 96.000 24.000 6.000 1.500 5 76.800 19.200 4.800 1.200 8 48.000 12.000 3.000 0.750 a 38.400 9.600 2.400 0.600 10 24.000 6.000 1.500 0.375 note1: transfer rates in i/o interface mode are eight times faster than the values given above. in uart mode, tmra match detect sign al (ta0trg) can be used for serial transfer clock. method for calculating the timer output frequency which is needed when outputting trigger of timer ta0trg frequency = baud rate 16 note2: the tmra0 match detect signal cannot be used as the transfer clock in i/o interface mode.
tmp92cy23/cd23a 2009-08-28 92cy23-183 (3) serial clock generation circuit this circuit generates the basic clock for transmitting and receiving data. ? in i/o interface mode in sclk output mode with the setting sc0cr = ?0?, the basic clock is generated by dividing the output of the baud rate generator by 2, as described previously. in sclk input mode with the setting sc0cr = ?1?, the rising edge or falling edge will be detected according to the setting of the sc0cr register to generate the basic clock. ? in uart mode the sc0mod0 setting determines whether the baud rate generator clock, the internal clock f sys , the match detect signal from tmra0 or the external clock (sclk0) is used to generate the basic clock sioclk. (4) receiving counter the receiving counter is a 4-bit binary counter used in uart mode, which counts up the pulses of the sioclk clock. it takes 16 sioclk pulses to receive 1 bit of data; each data bit is sampled three times on the 7th, 8th and 9th clock cycles. the value of the data bit is determined from these three samples using the majority rule. for example, if the data bit is sampled respec tively as ?1?, ?0? and ?1? on 7th, 8th and 9th clock cycles, the received data bit is taken to be ?1?. a data bit sampled as ?0?, ?0? and ?1? is taken to be ?0?. (5) receiving control ? in i/o interface mode in sclk output mode with the setting sc0cr = ?0?, the rxd0 signal is sampled on the rising edge or falling of the shift clock which is output on the sclk0 pin, according to th e sc0cr setting. in sclk input mode with the setting sc0cr = ?1?, the rxd0 signal is sampled on the rising or falling edge of the sclk0 input, according to the sc0cr setting. ? in uart mode the receiving control block has a circuit, which detects a start bit using the majority rule. received bits are sampled three times; when two or more out of three samples are ?0?, the bit is recogn ized as the start bit and the receiving operation commences. the values of the data bits that are received are also determined using the majority rule.
tmp92cy23/cd23a 2009-08-28 92cy23-184 (6) the receiving buffers to prevent overrun errors, the receiving bu ffers are arranged in a double buffer structure. received data is stored one bit at a time in receiving buffer 1 (which is a shift register). when 7 or 8 bits of data have been stored in receiving buffer 1, the stored data is transferred to receiving buffer 2 (sc0buf); this causes an intrx0 interrupt to be generated. the cpu only reads receiving buffer 2 (sc0buf). even before the cpu reads receiving buffer 2 (sc0buf), the received data can be stored in receiving buffer 1. however, unless receiving buffer 2 (sc0buf) is read before all bits of the next data are received by receiving buffer 1, an overrun error occurs. if an overrun error occurs, the contents of receiving buffer 1 will be lost, although the contents of receiving buffer 2 and sc0cr wi ll be preserved. sc0cr is used to store either the parity bit ? added in 8-bit uart mode ? or the most significant bit (msb) ? in 9-bit uart mode. in 9-bit uart mode the wakeup function for the slave controller is enabled by setting sc0mod0 to ?1?; in this mode intrx0 interrupts occur only when the value of sc0cr is ?1?. sio interrupt mode is select able by the register simc. (7) transmission counter the transmission counter is a 4-bit binary counter used in uart mode and which, like the receiving counter, counts the sioclk clock pulses; a txdclk pulse is generated every 16 sioclk clock pulses. figure 3.9.5 generation of the transmission clock (8) transmission controller ? in i/o interface mode in sclk output mode with the setting sc0cr = ?0?, the data in the transmission buffer is output one bit at a time to the txd0 pin on the rising or falling edge of the shift clock which is output on the sclk0 pin, according to the sc0cr setting. in sclk input mode with the setting sc0cr = ?1?, the data in the transmission buffer is output one bit at a time on the txd0 pin on the rising or falling edge of the sclk0 input, according to the sc0cr setting. ? in uart mode when transmission data sent from the cpu is written to the transmission buffer, transmission starts on the rising edge of the next txdclk. 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 sioclk txdclk
tmp92cy23/cd23a 2009-08-28 92cy23-185 handshake function use of cts pin allows data to be sent in unit s of one frame; thus, overrun errors can be avoided. the handshake function is enabled or disabled by the sc0mod setting. when the 0cts pin goes high on completion of the current data send, data transmission is halted until the 0cts pin goes low again. however, the inttx0 interrupt is generated, and it requests the next data send from the cpu. the next data is written in the transmission buffer and data sending is halted. though there is no rts pin, a handshake function can be easily configured by setting any port assigned to be the rts function. the rts should be output ?high? to request send data halt after data receive is completed by software in the rxd interrupt routine. figure 3.9.6 handshake function note 1: if the cts signal goes high during transmission, no more data will be sent after completion of the current transmission. note 2: transmission starts on the first falling edge of the txdclk clock after the cts signal has fallen. figure 3.9.7 cts (clear to send) timing txd cts0 rxd rts (any port) tmp92cy23/cd23a tmp92cy23/cd23a sender receiver 3 13 14 15 16 1 2 sioclk 3 14 15 16 1 2 start bit bit0 (1) (2) send is suspended from (1) and (2) timing of writing to the transmission buffe r txdclk txd cts
tmp92cy23/cd23a 2009-08-28 92cy23-186 (9) transmission buffer the transmission buffer (sc0buf) shifts out and sends the transmission data written from the cpu in order from the leas t significant bit (lsb). when all the bits are shifted out, the transmission buffer becomes empty and generates an inttx0 interrupt. (10) parity control circuit when sc0cr in the serial channel control register is set to ?1?, it is possible to transmit and receive data with parity. howe ver, parity can be added only in 7-bit uart mode or 8-bit uart mode. the sc0cr field in the serial channel control register allows either even or odd parity to be selected. in the case of transmission, parity is au tomatically generated when data is written to the transmission buffer sc0buf. the data is transmitted after the parity bit has been stored in sc0buf in 7-bit uart mode or in sc0mod0 in 8-bit uart mode. sc0cr and sc0cr mu st be set before the transmission data is written to the transmission buffer. in the case of receiving, data is shifted into receiving buffer 1, and the parity is added after the data has been transferred to rece iving buffer 2 (sc0buf), and then compared with sc0buf in 7-bit uart mode or with sc0cr in 8-bit uart mode. if they are not equal, a parity error is generated and the sc0cr flag is set. (11) error flags three error flags are provided to increase the reliability of data reception. 1. overrun error if all the bits of the next data item have been received in receiving buffer 1 while valid data still remains stored in receiving buffer 2 (sc0buf), an overrun error is generated. the below is a recommended flow when the overrun-error is generated. (intrx interrupt routine) 1) read receiving buffer 2) read error flag 3) if = ?1? then a) set to disable receiving (write ?0? to sc0mod0) b) wait to terminate current frame c) read receiving buffer d) read error flag e) set to enable receiving (write ?1? to sc0mod0) f) request to transmit again 4) other
tmp92cy23/cd23a 2009-08-28 92cy23-187 2. parity error the parity generated for the data shifte d into receiving buffer 2 (sc0buf) is compared with the parity bit received via the rxd pin. if they are not equal, a parity error is generated. 3. framing error the stop bit for the received data is sampled three times around the center. if the majority of the samples are ?0?, a framing error is generated. (12) timing generation 1. in uart mode receiving mode 9 bits (note) 8 bits + parity (note) 8 bits, 7 bits + parity, 7 bits interrupt timing center of last bit (bit8) center of last bit (parity bit) center of stop bit framing error timing center of stop bit center of stop bit center of stop bit parity error timing ? center of last bit (parity bit) center of stop bit overrun error timing center of last bit (bit8) center of last bit (parity bit) center of stop bit note1: in 9-bit and 8-bit ? parity modes, interrupts coin cide with the ninth bit pulse. thus, when servicing the interrupt, it is necessary to wait for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error. transmitting mode 9 bits 8 bits + parity 8 bits, 7 bits + parity, 7 bits interrupt timing just before stop bit is transmitted just before stop bit is transmitted just before stop bit is transmitted 2. i/o interface sclk output mode immediately after last bit data. (see figure 3.9.25.) transmission interrupt timing sclk input mode immediately after rise of last sclk signal rising mode, or immediately after fall in falling mode. (see figure 3.9.26.) sclk output mode timing used to transfer received to data receive buffer 2 (sc0buf) (e.g. immediately after last sclk). (see figure 3.9.27.) receiving interrupt timing sclk input mode timing used to transfer received data to receive buffer 2 (sc0buf) (e.g. immediately after last sclk). (see figure 3.9.28.)
tmp92cy23/cd23a 2009-08-28 92cy23-188 3.9.3 sfr 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 sc0mod0 (1202h) read/write r/w reset state 0 0 0 0 0 0 0 0 function transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clock (sclk0 input) serial transmission clock source (uart) 00 tmra0 match detect signal 01 baud rate generator 10 internal clock f sys 11 external clock (sclk0 input) note: the clock selection for the i/o interface mode is controlled by the serial control register (sc0cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart mode 9-bit mode wakeup function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when sc0cr = ?1? don?t care receiving function 0 receive disabled 1 receive enabled handshake function ( cts pin) 0 disabled (always transferable) 1 enabled transmission data bit8 figure 3.9.8 serial mode control register (for sio0)
tmp92cy23/cd23a 2009-08-28 92cy23-189 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 sc1mod0 (120ah) read/write r/w reset state 0 0 0 0 0 0 0 0 function transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clock (sclk1 input) serial transmission clock source (for uart) 00 tmra0 match detect signal 01 baud rate generator 10 internal clock f sys 11 external clock (sclk1 input) note: the clock selection for the i/o interface mode is controlled by the serial control register (sc1cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart mode 9-bit mode wakeup function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when sc1cr = ?1? don?t care receiving function 0 receive disabled 1 receive enabled handshake function ( cts pin) 0 disabled (always transferable) 1 enabled transmission data bit8 figure 3.9.9 serial mode control register (for sio1)
tmp92cy23/cd23a 2009-08-28 92cy23-190 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 sc2mod0 (1212h) read/write r/w reset state 0 0 0 0 0 0 0 0 function transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clock (sclk2 input) serial transmission clock source (for uart) 00 tmra0 match detect signal 01 baud rate generator 10 internal clock f sys 11 external clock (sclk2 input) note: the clock selection for the i/o interface mode is controlled by the serial control register (sc2cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart mode 9-bit mode wakeup function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when sc2cr = ?1? don?t care receiving function 0 receive disabled 1 receive enabled handshake function ( cts pin) 0 disabled (always transferable) 1 enabled transmission data bit8 figure 3.9.10 serial mode control register (for sio2)
tmp92cy23/cd23a 2009-08-28 92cy23-191 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc sc0cr (1201h) read/write r r/w r (cleared to 0 when read) r/w reset state undefined 0 0 0 0 0 0 0 1: error function received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input edge selection for sclk pin (i/o mode ) 0 transmits and receives data on rising edge of sclk0. 1 transmits and receives data on falling edge sclk0. framing error flag parity error flag overrun error flag cleared to ?0? when read parity additions enable 0 disabled 1 enabled even parity addition/check 0odd parity 1 even parity received data bit8 note: as all error flags are cleared after reading do not test only a single bit with a bit testing instruction. figure 3.9.11 serial control register (for sio0)
tmp92cy23/cd23a 2009-08-28 92cy23-192 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc sc1cr (1209h) read/write r r/w r (cleared to 0 when read) r/w reset state undefined 0 0 0 0 0 0 0 1: error function received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk1 1: sclk1 0: baud rate generator 1: sclk1 pin input i/o interface input clock select 0 baud rate generator 1 sclk1 pin input edge selection for sclk pin (input/output mode) 0 transmits and receives data on rising edge of sclk1. 1 transmits and receives data on falling edge of sclk1. framing error flag parity error flag overrun error flag cleared to ?0? when read parity additions enable 0 disabled 1 enabled even parity addition/check 0odd parity 1 even parity received data bit8 note: as all error flags are cleared after reading do not test only a single bit with a bit testing instruction. figure 3.9.12 serial control register (for sio1)
tmp92cy23/cd23a 2009-08-28 92cy23-193 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc sc2cr (1211h) read/write r r/w r (cleared to 0 when read) r/w reset state undefined 0 0 0 0 0 0 0 1: error function received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk2 1: sclk2 0: baud rate generator 1: sclk2 pin input i/o interface input clock select 0 baud rate generator 1 sclk2 pin input edge selection for sclk pin (input/output mode) 0 transmits and receives data on rising edge of sclk2. 1 transmits and receives data on falling edge of sclk2. framing error flag parity error flag overrun error flag cleared to ?0? when read parity additions enable 0 disabled 1 enabled even parity addition/check 0odd parity 1 even parity received data bit8 note: as all error flags are cleared after reading do not test only a single bit with a bit testing instruction. figure 3.9.13 serial control register (for sio2)
tmp92cy23/cd23a 2009-08-28 92cy23-194 7 6 5 4 3 2 1 0 bit symbol ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 br0cr (1203h) read/write r/w reset state 0 0 0 0 0 0 0 0 function always write ?0?. + (16 ? k)/16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting 7 6 5 4 3 2 1 0 bit symbol br0k3 br0k2 br0k1 br0k0 br0add (1204h) read/write r/w reset state 0 0 0 0 function sets frequency divisor ?k? (divided by n + (16 ? k)/16). sets baud rate generator frequency divisor br0cr = ?1? br0cr = ?0? br0cr br0add 0000 (n = 16) or 0001 (n = 1) 0010 (n = 2) to 1111 (n = 15) 0001 (n = 1) (only uart) to 1111 (n = 15) 0000 (n = 16) 0000 disable disable 0001 (k = 1) to 1111 (k = 15) disable divided by n + (16 ? k)/16 divided by n note1:availability of +(16-k)/16 division function n uart mode i/o mode 2 to 15 1 , 16 the baud rate generator can be set to ?1? in uart mo de only when the +(16-k)/16 division function is not used. do not use in i/o interface mode. note2:set br0cr to ?1? after setting k (k = 1 to 15) to br0add when the +(16-k)/16 division function is used. if the unused bits in the br0add register is written, it does not affect operation. if that bits is read, it becomes undefined.. figure 3.9.14 baud rate generator control (for sio0) setting the input clock of baud rate generator 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 + (16 ? k)/16 division enable 0 disable 1 enable
tmp92cy23/cd23a 2009-08-28 92cy23-195 7 6 5 4 3 2 1 0 bit symbol ? br1adde br1ck1 br1ck0 br1s3 br1s2 br1s1 br1s0 br1cr (120bh) read/write r/w reset state 0 0 0 0 0 0 0 0 function always write ?0?. + (16 ? k)/16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting 7 6 5 4 3 2 1 0 bit symbol br1k3 br1k2 br1k1 br1k0 br1add (120ch) read/write r / w reset state 0 0 0 0 function set frequency divisor k (divided by n + (16 ? k)/16). baud rate generator frequency divisor setting br1cr = ?1? br1cr = ?0? br1cr br1add 0000 (n = 16) or 0001 (n = 1) 0010 (n = 2) to 1111 (n = 15) 0001 (n = 1) (only uart) to 1111 (n = 15) 0000 (n = 16) 0000 disable disable 0001 (k = 1) to 1111 (k = 15) disable divided by n + (16 ? k)/16 divided by n note1:availability of +(16-k)/16 division function n uart mode i/o mode 2 to 15 1 , 16 the baud rate generator can be set to ?1? in uart mo de only when the +(16-k)/16 division function is not used. do not use in i/o interface mode. note2:set br1cr to ?1? after setting k (k = 1 to 15) to br1add when the +(16-k)/16 division function is used. if the unused bits in the br1add register is written, it does not affect operation. if that bits is read, it becomes undefined. figure 3.9.15 baud rate generator control (for sio1) input clock selection for baud rate generator 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 + (16 ? k)/16 division enable 0 disabled 1 enabled
tmp92cy23/cd23a 2009-08-28 92cy23-196 7 6 5 4 3 2 1 0 bit symbol ? br2adde br2ck1 br2ck0 br2s3 br2s2 br2s1 br2s0 br2cr (1213h) read/write r/w reset state 0 0 0 0 0 0 0 0 function always write ?0?. + (16 ? k)/16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting 7 6 5 4 3 2 1 0 bit symbol br2k3 br2k2 br2k1 br2k0 br2add (1214h) read/write r/w reset state 0 0 0 0 function sets frequency divisor ?k? (divided by n + (16 ? k)/16). sets baud rate generator frequency divisor br2cr = ?1? br2cr = ?0? br2cr br2add 0000 (n = 16) or 0001 (n = 1) 0010 (n = 2) to 1111 (n = 15) 0001 (n = 1) (only uart) to 1111 (n = 15) 0000 (n = 16) 0000 disable disable 0001 (k = 1) to 1111 (k = 15) disable divided by n + (16 ? k)/16 divided by n note1:availability of +(16-k)/16 division function n uart mode i/o mode 2 to 15 1 , 16 the baud rate generator can be set to ?1? in uart mo de only when the +(16-k)/16 division function is not used. do not use in i/o interface mode. note2:set br2cr to ?1? after setting k (k = 1 to 15) to br2add when the +(16-k)/16 division function is used. if the unused bits in the br2add register is written, it does not affect operation. if that bits is read, it becomes undefined.. figure 3.9.16 baud rate generator control (for sio2) setting the input clock of baud rate generator 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 + (16 ? k)/16 division enable 0 disable 1 enable
tmp92cy23/cd23a 2009-08-28 92cy23-197 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (transmission) sc0buf (1200h) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (receiving) note: a read-modify-write operation cannot be performed in sc0buf. figure 3.9.17 serial transmission/re ceiving buffer registers (for sio0) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 read/write r/w reset state 0 0 sc0mod1 (1205h) function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.18 serial mode control register 1 (for sio0) 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (transmission) sc1buf (1208h) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (receiving) note: a read-modify-write operation cannot be performed in sc1buf. figure 3.9.19 serial transmission/re ceiving buffer registers (for sio1) 7 6 5 4 3 2 1 0 bit symbol i2s1 fdpx1 read/write r / w reset state 0 0 sc1mod1 (120dh) function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.20 serial mode control register 1 (for sio1)
tmp92cy23/cd23a 2009-08-28 92cy23-198 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (transmission) sc2buf (1210h) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (receiving) note: a read-modify-write operation cannot be performed in sc2buf. figure 3.9.21 serial transmission/re ceiving buffer registers (for sio2) 7 6 5 4 3 2 1 0 bit symbol i2s2 fdpx2 read/write r / w reset state 0 0 sc2mod1 (1215h) function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.22 serial mode control register 1 (for sio2)
tmp92cy23/cd23a 2009-08-28 92cy23-199 3.9.4 operation in each mode (1) mode 0 (i/o interface mode) this mode allows an increase in the number of i/o pins available for transmitting data to or receiving data from an external shift register. this mode includes the sclk output mode to output synchronous clock sclk and sclk input mode to input external synchronous clock sclk. figure 3.9.23 sclk output mode connection example figure 3.9.24 example of sclk input mode connection output extension tc74hc595 or equivalent a b si c d sck e f rck g h txd sclk port shift register tmp92cy23/cd23a input extension tc74hc165 or equivalent a b qh c d clock e f s/ l g h rxd sclk port shift register tmp92cy23/cd23a output extension tc74hc595 or equivalent a b si c d sck e f rck g h txd sclk port shift register tmp92cy23/cd23a input extension tc74hc165 or equivalent a b qh c d clock e f s/ l g h rxd sclk port shift register tmp92cy23/cd23a external clock external clock
tmp92cy23/cd23a 2009-08-28 92cy23-200 1. transmission in sclk output mode 8-bit data and a synchronous clock are output on the txd0 and sclk0 pins respectively each time the cpu writes data to the transmission buffer. when all data is output, intes0 will be set to generate the inttx0 interrupt. figure 3.9.25 transmitting operation in i/o interface mode (sclk0 output mode) in sclk input mode, 8-bit data is output on the txd0 pin when the sclk0 input becomes active after the data has been written to the transmission buffer by the cpu. when all data is output, intes0 will be set to generate an inttx0 interrupt. figure 3.9.26 transmitting operation in i/o interface mode (sclk0 input mode) bit0 bit1 bit6 bit7 bit5 sclk0 input ( = ?0?: rising edge mode) sclk0 input ( = ?1?: falling edge mode) txd0 itx0c (inttx0 intterrupt reqest) txd0 itx0c (inttx0 interrupt request) sclk0 output ( = ?0?: rising edge mode) timing of transmitted data writing bit0 bit1 bit6 bit7 sclk0 output ( = ?1?: falling edge mode) (internal clock timing)
tmp92cy23/cd23a 2009-08-28 92cy23-201 2. receiving in sclk output mode the synchronous clock is output on the sclk0 pin and the data is shifted to receiving buffer 1. this is initiated when the receive interrupt flag intes0 is cleared as the received data is read. when 8-bit data is received, the data is transferred to receiving buffer 2 (sc0buf) following the timing shown below and intes0 is set to ?1? again, causing an intrx0 interrupt to be generated. setting sc0mod0 to ?1? initiates sclk0 output. figure 3.9.27 receiving operation in i/o interface mode (sclk0 output mode) in sclk input mode the data is shifted to receiving buffer 1 when the sclk input goes active. the sclk input goes active when the receive interrupt flag intes0 is cleared as the received data is read. when 8-bit data is received, the data is shifted to receiving buffer 2 (sc0buf) following the timing shown below and intes0 is set to ?1? again, causing an intrx0 interrupt to be generated. figure 3.9.28 receiving operation in i/o interface mode (sclk0 input mode) note: the system must be put in the receive-enable state (sc0mod0 = ?1?) before data can be received. sclk0 output ( = ?0?: rising edge mode) irx0c (intrx0 interrupt request) rxd0 bit0 bit1 bit6 bit7 sclk0 output ( = ?1?: falling edge mode) sclk0 input ( = ?0?: rising edge mode) sclk0 input ( = ?1?: falling edge mode) irx0c (intrx0 interrupt request) rxd0 bit1 bit6 bit7 bit5 bit 0
tmp92cy23/cd23a 2009-08-28 92cy23-202 3. transmission and receiving (full duplex mode) when full duplex mode is used, set the receive interrupt level to 0, and only set the interrupt level (from 1 to 6) of the the transmig interrupt. ensure that the program which transmits the interrupt reads the receiving buffer before setting the next transmit data. the following is an example of this: example: channel 0, sclk output baud rate = 9600 bps fc = 14.7456 mhz * clock condition: clock gear 1/1(fc) main routine 7 6543210 intes0 x 0 0 1 x 0 0 0 set the inttx0 level to 1. set the intrx0 level to 0. pfcr ? ? ? ? ? 101 pffc ? ? ? ? ? 111 set pf0, pf1 and pf2 to function as the txd0, rxd0 and sclk0 pins respectively. sc0mod0 0 0 0 0 0 0 0 0 select i/o interface mode. sc0mod1 1 1 0 0 0 0 0 0 select full duplex mode. sc0cr 0 0 0 0 0 0 0 0 set the sclk output, transmit on negative edge, and receive on positive edge. br0cr 0 0 1 1 0 0 1 1 set to 9600 bps. sc0mod0 0 0 1 0 0 0 0 0 set receive to enable. sc0buf * ******* set the transmit data and start. inttx0 interrupt routine a cc sc0buf read the receiving buffer. sc0buf * ******* set the next transmit data. x: don't care, ? : no change (2) mode 1 (7-bit uart mode) 7-bit uart mode is selected by setting the serial channel mode register sc0mod0 field to ?01?. in this mode a parity bit can be added. use of a parity bit is enabled or disabled by the setting of the serial channel control re gister sc0cr bit; whether even parity or odd parity will be used is determined by the sc0cr setting when sc0cr is set to ?1? (enabled). setting example: when transmitting data of the following format, the control registers should be se t as described below. * clock condition: clock gear 1/1(fc) 7 6 5 4 3 2 1 0 pfcr ? ? ? ? ? ? ? 1 pffc ? ? ? ? ? ? ? 1 set pf0 to function as the txd0 pin. sc0mod0 x 0 ? x 0 1 0 1 select 7-bit uart mode. sc0cr x 1 1 x x x 0 0 add even parity. br0cr 0 0 1 0 1 0 0 0 set to 2400 bps. intes0 x 1 0 0 ? ? ? ? set inttx0 interrupt to enable and set to level 4. sc0buf * * * * * * * * set the transmit data. x: don't care, ?: no change start bit0 1 2 3 4 5 6 even parity stop transmission direction (transmission rate: 2400 bps at f sys = 19.6608 mhz)
tmp92cy23/cd23a 2009-08-28 92cy23-203 (3) mode 2 (8-bit uart mode) 8-bit uart mode is selected by setting sc0mod0 to ?10?. in this mode a parity bit can be added (use of a parity bi t is enabled or disabled by the setting of sc0cr); whether even parity or odd pari ty will be used is determined by the sc0cr setting when sc0cr< pe> is set to ?1? (enabled). setting example: when receiving data of the following format, the control registers should be se t as described below. main settings 7 6 5 4 3 2 1 0 pfcr ? ? ? ? ? ? 0 ? set pf1 to function as the rxd0 pin. pffc ? ? ? ? ? ? 1 ? sc0mod0 ? 0 1 x 1001 enable receiving in 8-bit uart mode. sc0cr x 0 1 x x x 0 0 add odd parity. br0cr 0 0 0 1 1 0 0 0 set to 9600 bps. intes0 ? ? ? ? x100 set inttx0 interrupt to enable and set to level 4. interrupt processing a cc sc0cr and 00011100 if a cc 0 then error check for errors a cc sc0buf read the received data x: don't care, ? : no change transmission direction (transmission rate: 9600 bps at f sys = 19.6608 mhz) startbit0 1 23456 odd parity stop 7
tmp92cy23/cd23a 2009-08-28 92cy23-204 (4) mode 3 (9-bit uart mode) 9-bit uart mode is selected by settin g sc0mod0 to ?11?. in this mode parity bit cannot be added. in the case of transmission the msb (9th bit) is written to sc0mod0. in the case of receiving it is stored in sc0cr. when the buffer is written or read, the or is read or written first, before the rest of the sc0buf data. wakeup function in 9-bit uart mode, the wakeup function for slave controllers is enabled by setting sc0mod0 to ?1?. the interrupt intrx0 can only be generated when = ?1?. note: the txd pin of each slave controller must be in open-drain output mode. figure 3.9.29 serial link using wakeup function txd rxd master txd rxd slave1 txd rxd slave 2 txd rxd slave 3
tmp92cy23/cd23a 2009-08-28 92cy23-205 protocol 1. select 9-bit uart mode on the master and slave controllers. 2. set the sc0mod0 bit on each slave co ntroller to ?1? to enable data receiving. 3. the master controller transmits data one frame at a time. each frame includes an 8-bit select code which identifies a slave controller. the msb (bit8) of the data () is set to ?1?. 4. each slave controller receives the above frame. each controller checks the above select code against its own select code. the controll er whose code matches clears its bit to ?0?. 5. the master controller transmits data to the specified slave controller (the controller whose sc0mod0 bit has been cleared to 0). the msb (bit8) of the data () is cleared to ?0?. 6. the other slave controllers (whose bits remain at ?1?) ignore the received data because their msbs (bit8 or ) are set to ?0?, disabling intrx0 interrupts. the slave controller whose bit = ?0? can also transmit to the master controller. in this way it can signal the master controller that the data transmission from the master controller has been completed. start bit0123456 select code of slave controller 7 stop 8 ?1? data ?0? start bit0123456 7 stop bit8
tmp92cy23/cd23a 2009-08-28 92cy23-206 setting example: to link two slave controllers serially with the master controller using the internal clock f sys as the transfer clock. ? setting the master controller main pfcr ? ? ? ? ? ? 01 pffc ? ? ? ? ? ? 11 set pf0 and pf1 to function as the txd0 and rxd0 pins respectively. intes0 x 1 0 0 x 1 0 1 set inttx0 to enable, an d set interrupt level to level 4. set intrx0 to enable, and set interrupt level to level 5. sc0mod0 1 0 1 0 1 1 1 0 set f sys as the transmission clock for 9-bit uart mode. sc0buf 0 0 0 0 0 0 0 1 set the select code for slave controller 1. inttx0 interrupt sc0mod0 0 ? ? ? ? ? ? ? set tb8 to ?0?. sc0buf * * * * * * * * set the transmission data. ? setting the slave controller main pfcr ? ? ? ? ? ? 01 pffc ? ? ? ? ? ? 11 set pf1 and pf0 to function as the rxd0 and txd0 pins respectively. intes0 x 1 0 0 x 1 0 1 set intrx0 to enable, and set interrupt level to level 4. set intrx0 to enable, and set interrupt level to level 5 sc0mod0 0 0 1 1 1 1 1 0 set to = ?1? in 9-bit uart mode transfer clock f sys . intrx0 interrupt a cc sc0buf if a cc = select code then sc0mod0 ? ? ? 0 ? ? ? ? clear to ?0? txd rxd master txd rxd slave1 txd rxd slave 2 select code 00000001 select code 00001010
tmp92cy23/cd23a 2009-08-28 92cy23-207 3.9.5 support for irda sio0, sio1 and sio2 include support for the irda 1.0 infrared data communication specification. figure 3.9.30 shows the block diagram. figure 3.9.30 block diagram (1) modulation of the transmission data when the transmit data is ?0?, the modem outputs 1 to txd0 pin with either 3/16 or 1/16 times for width of baud rate. the pulse width is selected by the sir0cr. when the transmit data is ?1?, the modem outputs ?0?. figure 3.9.31 transmission example (sio0) (2) modulation of the receive data when the receive data has an effective pulse of ?1?, the modem outputs ?0? to sio0. otherwise the modem outputs ?1? to sio0. the effective pulse width is selected by sir0cr. figure 3.9.32 receiving example (sio0) start transmission data stop 0 0 001 01 1 txd0 pin start data after modulation sto p 1 1 00 1 0 1 0 receiving pulse = ?0? receiving pulse = ?1? transmisison data sio0 ir modulator ir demodulator receive data ir transmitter & led ir receiver modem txd0 rxd0 ir output ir input tmp92cy23/cd23a
tmp92cy23/cd23a 2009-08-28 92cy23-208 (3) data format the data format is fixed as follows: ? data length: 8 bits ? parity bits: none ? stop bits: 1 bit (4) sfr figure 3.9.33, figure 3.9.34 and figure 3.9.35 show the control register sir0cr, sir 1cr and sir2cr. set sirxcr data while siox is stopped. the following example describes how to se t this register: 1) sio setting ; set the sio to uart mode. 2) ld (sir0cr), 07h ; set the receive data pulse width to 16 + 100ns. 3) ld (sir0cr), 37h ; txen, rxen enable the transmission and receiving. 4) start transmission and receiving for sio0 ; the modem operates as follows: ? sio0 starts transmitting. ? ir receiver starts receiving.
tmp92cy23/cd23a 2009-08-28 92cy23-209 (5) notes 1. baud rate for irda when irda is operated, set ?01? to sc0mod0 to generate baud rate. setting other than the above (ta0trg, f io and sclk0 input) cannot be used. 2. the pulse width for transmission the irda 1.0 specification is defined in table 3.9.4. table 3.9.4 baud rate and pulse wi dth specifi cations baud rate modulation rate tolerance (% of rate) pulse width (min) pulse width (typ.) pulse width (max) 2.4 kbps rzi 0.87 1.41 s 78.13 s 88.55 s 9.6 kbps rzi 0.87 1.41 s 19.53 s 22.13 s 19.2 kbps rzi 0.87 1.41 s 9.77 s 11.07 s 38.4 kbps rzi 0.87 1.41 s 4.88 s 5.96 s 57.6 kbps rzi 0.87 1.41 s 3.26 s 4.34 s 115.2 kbps rzi 0.87 1.41 s 1.63 s 2.23 s the pulse width is defined as either baud rate t 3/16 or 1.6 s (1.6 s is equal to 3/16 pulse width when baud rate is 115.2 kbps). the tmp92cy23/cd23a has a function which can select the pulse width of transmission as either 3/16 or 1/16. however, 1/16 pulse width can only be selected when the baud rate is equal to or less than 38.4 kbps. for the same reason, the + (16 ? k)/16 division function in the baud rate generator of sio0 cannot be used to generate a 115.2 kbps baud rate. the + (16 ? k)/16 division function cannot be used also when the baud rate is 38.4 kbps and the pulse width 1/16. table 3.9.5 baud rate and pulse width for (16 ? k)/16 division function baud rate pulse width 115.2 kbps 57.6 kbps 38.4 kbps 19.2 kbps 9.6 kbps 2.4 kbps t 3/16 t 1/16 ? ? : (16 ? k)/16 division function can be used. : (16 ? k)/16 division function cannot be used. ? : 1/16 pulse width cannot be used.
tmp92cy23/cd23a 2009-08-28 92cy23-210 7 6 5 4 3 2 1 0 bit symbol plsel rxsel txen rxen sir0wd3 sir0wd2 sir0wd1 sir0wd0 sir0cr (1207h) read/write r/w reset state 0 0 0 0 0 0 0 0 function select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width to equal to or more than 2x (value + 1) + 100 ns can be set: 1 to 14 cannot be set: 0, 15 select receive pulse width formula: effective pulse width 2x (value + 1) + 100 ns x = 1/f fph 0000 cannot be set 0001 equal to or more than 4x + 100 ns to 1110 equal to or more than 30x + 100 ns 1111 cannot be set receive operation 0 disable (received input is ignored) 1 enable transmit operation 0 disable (input from sio is ignored) 1 enable select transmit pulse width 0 3/16 1 1/16 figure 3.9.33 irda control register (for sio0) note: if a pulse width complying with irda1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to ?1? will result in reduced power dissipation.
tmp92cy23/cd23a 2009-08-28 92cy23-211 7 6 5 4 3 2 1 0 bit symbol plsel rxsel txen rxen sir1wd3 sir1wd2 sir1wd1 sir1wd0 sir1cr (120fh) read/write r/w reset state 0 0 0 0 0 0 0 0 function select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width to equal to or more than 2x (value + 1) + 100 ns can be set: 1 to 14 cannot be set: 0, 15 select receive pulse width formula: effective pulse width 2x (value + 1) + 100 ns x = 1/f fph 0000 cannot be set 0001 equal to or more than 4x + 100 ns to 1110 equal to or more than 30x + 100 ns 1111 cannot be set receive operation 0 disable (received input is ignored) 1 enable transmit operation 0 disable (input from sio is ignored) 1 enable select transmit pulse width 0 3/16 1 1/16 figure 3.9.34 irda control register 1 (for sio1) note: if a pulse width complying with irda1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to ?1? will result in reduced power dissipation.
tmp92cy23/cd23a 2009-08-28 92cy23-212 7 6 5 4 3 2 1 0 bit symbol plsel rxsel txen rxen sir2wd3 sir2wd2 sir2wd1 sir2wd0 sir2cr (1217h) read/write r/w reset state 0 0 0 0 0 0 0 0 function select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse to width equal to or more than 2x (value + 1) + 100 ns can be set: 1 to 14 cannot be set: 0, 15 select receive pulse width formula: effective pulse width 2x (value + 1) + 100 ns x = 1/f fph 0000 cannot be set 0001 equal to or more than 4x + 100 ns to 1110 equal to or more than 30x + 100 ns 1111 cannot be set receive operation 0 disable (received input is ignored) 1 enable transmit operation 0 disable (input from sio is ignored) 1 enable select transmit pulse width 0 3/16 1 1/16 figure 3.9.35 irda control register 2 (for sio2) note: if a pulse width complying with irda1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to ?1? will result in reduced power dissipation.
tmp92cy23/cd23a 2009-08-28 92cy23-213 3.10 serial bus interface (sbi) the tmp92cy23/cd23a has 2-channel serial bus interface which employs a clocked-synchronous 8-bit sio mode and an i 2 c bus mode. they are called sbi0 and sbi1. the serial bus interface is connected to an external device through pn1 (sda0) and pn2 (scl0), pn4 (sda1) and pn5 (scl1) in the i 2 c bus mode; and through pn0 (sck0), pn1 (so0), pn2 (si0), pn3 (sck1), pn4 (so1) and pn5 (si1) in the clocked-synchronous 8-bit sio mode. each of the channels can be operated independently. since both sbi0 and sbi1 channels operate in the same manner, a channel explains only the case of sbi0. each pin is specified as follows: (sbi0) pncr pnfc i 2 c bus mode 11x 11x clocked synchronous 8-bit sio mode 011 010 x11 each pin is specified as follows: (sbi1) pncr pnfc i 2 c bus mode 11x 11x clocked synchronous 8-bit sio mode 011 010 x11 x: don?t care
tmp92cy23/cd23a 2009-08-28 92cy23-214 3.10.1 configuration figure 3.10.1 serial bus interface 0 (sbi0) figure 3.10.2 serial bus interface 1 (sbi1) pn3 (sck1) sio clock control divider i 2 c bus clock sync. + control sbi1cr2/ sbi1sr scl sck input/ output control so si sda i2c1ar sbi1br sbi1cr1 sbi1br0, 1 shift register transfer control circuit noise canceller t noise canceller i 2 c bus data control sio data control intsbe1 interrupt request (address/data) pn4 (so1/sda1) pn5 (si1/scl1) sbi1 control register 2/ sbi1 status register i 2 c bus 1 address register sbi1 data buffer register sbi1 control register 1 sbi1 baud rate register 0, 1 pn0 (sck0) sio clock control divider i 2 c bus clock sync. + control sbi0cr2/ sbi0sr scl sck input/ output control so si sda i2c0ar sbi0br sbi0cr1 sbi0br0, 1 shift register transfer control circuit noise canceller t noise canceller i 2 c bus data control sio data control intsbe0 interrupt request (address/data) pn1 (so0/sda0) pn2 (si0/scl0) sbi0 control register 2/ sbi0 status registe r i 2 c bus 0 address register sbi0 data buffer register sbi0 control register 1 sbi0 baud rate register 0, 1
tmp92cy23/cd23a 2009-08-28 92cy23-215 3.10.2 serial bus interface (sbi) control the following registers are used to control the serial bus interface and monitor the operation status. ? serial bus interface 0 control register 1 (sbi0cr1), (sbi1cr1) ? serial bus interface 0 control register 2 (sbi0cr2), (sbi1cr2) ? serial bus interface 0 data buffer register (sbi0dbr), (sbi1dbr) ? i 2 c bus 0 address register (i2c0ar), (i2c1ar) ? serial bus interface 0 status register (sbi0sr), (sbi1sr) ? serial bus interface 0 baud rate register 0 (sbi0br0), (sbi1br0) ? serial bus interface 0 baud rate register 1 (sbi0br1), (sbi1br1) the above registers differ depending on a mo de to be used. refer to section 3.10.4 ?i 2 c bus mode control register? and 3.10.7 ?clock ed-synchronous 8-bit sio mode control?. 3.10.3 the data formats in the i 2 c bus mode the data formats in the i 2 c bus mode are shown below. (a) addressing format (b) addressing format (with restart) (c) free data format (data transferred from master device to slave device) figure 3.10.3 data format in the i 2 c bus mode s slave address r / w data a c k a c k s slave address r / w data a c k a c k p 8 bits 1 1 to 8 bits 1 8 bits 1 1 to 8 bits 1 1 1 or more 1 1 or more s slave address r / w data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s data data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s: start condition r/ w : direction bit ack: acknowledge bit p: stop condition
tmp92cy23/cd23a 2009-08-28 92cy23-216 3.10.4 i 2 c bus mode control register the following registers are used to control and monitor the operation status when using the serial bus interface (sbi0, sbi1) in the i 2 c bus mode. serial bus interface 0 control register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon sbi0cr1 (1240h) read/write w r/w w r/w reset state 0 0 0 0 0 0 0/1 (note 3) a read-modify- write operation cannot be performed. function number of transferred bits (note 1) a cknowledge edge mode specification 0: not generate 1:generate internal serial clock selection and software reset monitor (note 2) internal serial clock selection at write 000 n = 5 ? (note 4) 001 n = 6 ? (note 4) system clock: f sys 010 n = 7 ? (note 4) f sys = 20 mhz 011 n = 8 ? (note 4) (internal scl output) 100 n = 9 76.9 khz 101 n = 10 38.8 khz f sys 2 110 n = 11 19.5 khz f scl = 2 n + 8 [hz] 111 reserved (reserved) software reset state monitor at read 0 during software reset 1 initial data acknowledge mode specification 0 not generate clock pulse for acknowledge signal 1 generate clock pulse for acknowledge signal number of bits transferred = ?0? = ?1? number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 note 1: set the to ?000? before switching to a clocked-synchronous 8-bit sio mode. note 2: for the frequency of the scl pin clock, see 3.10.5 (3) ?serial clock?. note 3: initial data of sck0 is ?0?, swrmon is ?1?. note 4: this i 2 c bus circuit does not support fast mode, it supports standard mode only. although the i 2 c bus circuit itself allows the setting of a baud rate over 100 kbps, the compliance with the i 2 c specification is not guaranteed in that case. figure 3.10.4 registers for the i 2 c bus mode (sbi0)
tmp92cy23/cd23a 2009-08-28 92cy23-217 serial bus interface 1 control register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon sbi1cr1 (1248h) read/write w r/w w r/w reset state 0 0 0 0 0 0 0/1 (note 3) a read-modify- write operation cannot be performed. function number of transferred bits (note 1) a cknowledge edge mode specification 0: not generate 1: generate internal serial clock selection and software reset monitor (note 2) internal serial clock selection at write 000 n = 5 ? (note 4) 001 n = 6 ? (note 4) system clock: f sys 010 n = 7 ? (note 4) f sys = 20 mhz 011 n = 8 ? (note 4) (internal scl output) 100 n = 9 76.9 khz 101 n = 10 38.8 khz f sys 2 110 n = 11 19.5 khz f scl = 2 n + 8 [hz] 111 reserved (reserved) software reset state monitor at read 0 during software reset 1 initial data acknowledge mode specification 0 not generate clock pulse for acknowledge signal 1 generate clock pulse for acknowledge signal number of bits transferred = ?0? = ?1? number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 note 1: set the to ?000? before switching to a clocked-synchronous 8-bit sio mode. note 2: for the frequency of the scl pin clock, see 3.10.5 (3) ?serial clock?. note 3: initial data of sck0 is ?0?, swrmon is ?1?. note 4: this i 2 c bus circuit does not support fast mode, it supports standard mode only. although the i 2 c bus circuit itself allows the setting of a baud rate over 100 kbps, the compliance with the i 2 c specification is not guaranteed in that case. figure 3.10.5 registers for the i 2 c bus mode (sbi1)
tmp92cy23/cd23a 2009-08-28 92cy23-218 serial bus interface 0 control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 sbi0cr2 (1243h) read/write w w (note 1) w (note 1) reset state 0 0 0 1 0 0 0 0 a read-modify- write operation cannot be performed function master/ slave selection transmitter /receiver selection start/stop condition generation cancel intsbe0 interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal software reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) intsbe0 interrupt request 0 ? 1 cancel interrupt request start/stop condition generation 0 generates the stop condition 1 generates the start condition transmitter/receiver selection 0 receiver 1 transmitter master/slave selection 0slave 1master note 1: reading this register function as sbi0sr register. note 2: switch a mode to port mode after confirming that the bus is free. switch a mode between i 2 c bus mode and clocked-synchronous 8-bit sio mode after confirming that input signals via port are high level. figure 3.10.6 registers for the i 2 c bus mode (sbi0)
tmp92cy23/cd23a 2009-08-28 92cy23-219 serial bus interface 1 control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 sbi1cr2 (124bh) read/write w w (note 1) w (note 1) reset state 0 0 0 1 0 0 0 0 a read-modify- write operation cannot be performed. function master/ slave selection transmitter /receiver selection start/stop condition generation cancel intsbe1 interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal software reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) intsbe1 interrupt request 0 ? 1 cancel interrupt request start/stop condition generation 0 generates the stop condition 1 generates the start condition transmitter/receiver selection 0 receiver 1 transmitter master/slave selection 0slave 1master note 1: reading this register function as sbi1sr register. note 2: switch a mode to port mode after confirming that the bus is free. switch a mode between i 2 c bus mode and clocked-synchronous 8-bit sio mode after confirming that input signals via port are high level. figure 3.10.7 registers for the i 2 c bus mode (sbi1)
tmp92cy23/cd23a 2009-08-28 92cy23-220 serial bus interface 0 status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb sbi0sr (1243h) read/write r reset state 0 0 0 1 0 0 0 0 a read-modify- write operation cannot be performed. function master/ slave status selection monitor transmitter /receiver status selection monitor i 2 c bus status monitor intsbe0 interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbe0 interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free 1busy transmitter/receiver status monitor 0 receiver 1 transmitter master/slave status monitor 0slave 1master note: writing in this register functions as sbi0cr2. figure 3.10.8 registers for the i 2 c bus mode (sbi0)
tmp92cy23/cd23a 2009-08-28 92cy23-221 serial bus interface 1 status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb sbi1sr (124bh) read/write r reset state 0 0 0 1 0 0 0 0 a read-modify- write operation cannot be performed. function master/ slave status selection monitor transmitter /receiver status selection monitor i 2 c bus status monitor intsbe1 interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbe1 interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free 1busy transmitter/receiver status monitor 0 receiver 1 transmitter master/slave status monitor 0slave 1master note: writing in this register functions as sbi1cr2. figure 3.10.9 registers for the i 2 c bus mode (sbi1)
tmp92cy23/cd23a 2009-08-28 92cy23-222 serial bus interface 0 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol ? i2sbi0 sbi0br0 (1244h) read/write w r/w reset state 0 0 a read-modify- write operation cannot be performed function always write ?0?. idle2 0: stop 1: run operation during idle2 mode 0 stop 1 operation serial bus interface 0 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4en ? sbi0br1 (1245h) read/write w reset state 0 0 a read-modify- write operation cannot be performed function internal clock 0: stop 1: run always write ?0?. baud rate clock control 0 stop 1 operate serial bus interface 0 data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 sbi0dbr (1241h) read/write r (receiving)/w (transmission) reset state undefined a read-modify- write operation cannot be performed note 1: when writing transmission data, start from the msb (bit7). receiving data is placed from lsb (bit0). note 2: sbi0dbr cannot be read the written data. therefore a read-modify-write operation (e.g., ?bit? instruction) cannot be performed. note 3: written data in sbi0dbr is cleared by intsbe0 signal. i 2 c bus address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als i2c0ar (1242h) read/write w reset state 0 0 0 0 0 0 0 0 a read-modify- write operation cannot be performed. function slave address selection for when dev ice is operating as slave device address recognition mode specification address recognition mode specification 0 slave address recognition 1 non slave address recognition figure3.10.10 registers for the i 2 c bus mode (sbi0)
tmp92cy23/cd23a 2009-08-28 92cy23-223 serial bus interface 1 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol ? i2sbi0 sbi1br0 (124ch) read/write w r/w reset state 0 0 a read-modify- write operation cannot be performed function always write ?0?. idle2 0: stop 1: run operation during idle2 mode 0 stop 1 operation serial bus interface 1 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4en ? sbi1br1 (124dh) read/write w reset state 0 0 a read-modify- write operation cannot be performed function internal clock 0: stop 1: run always write ?0?. baud rate clock control 0 stop 1 operate serial bus interface 1 data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 sbi1dbr (1249h) read/write r (receiving)/w (transmission) reset state undefined a read-modify- write operation cannot be performed. note 1: when writing transmission data, start from the msb (bit7). receiving data is placed from lsb (bit0). note 2: sbi1dbr cannot be read the written data. therefore a read-modify-write operation (e.g., ?bit? instruction) cannot be performed. note 3: written data in sbi1dbr is cleared by intsbe1 signal. i 2 c bus address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als i2c1ar (124ah) read/write w reset state 0 0 0 0 0 0 0 0 a read-modify- write operation cannot be performed function slave address selection for when dev ice is operating as slave device address recognition mode specification address recognition mode specification 0 slave address recognition 1 non slave address recognition figure 3.10.11 registers for the i 2 c bus mode (sbi1)
tmp92cy23/cd23a 2009-08-28 92cy23-224 3.10.5 control in i 2 c bus mode (1) acknowledge mode specification set the sbi0cr1 to ?1? for oper ation in the acknowledge mode. the tmp92cy23/cd23a generates an additional clock pulse for an acknowledge signal when operating in master mode. in the transmitter mode during the clock pulse cycle, the sda0 pin is released in order to receive the acknowledge signal from the receiver. in the receiver mode during the clock pulse cycle, the sda0 pin is set to the low in order to generate the acknowledge signal. clear the to ?0? for operation in the non-acknowledge mode. the tmp92cy23/cd23a does not generate a clock pulse for the acknowledge signal when operating in the master mode. (2) number of transfer bits since the sbi0cr1 is cleared to ?000? on start up, a slave address and direction bit transmissions are executed in 8 bits. other than these, the retains a specified value. (3) serial clock 1. clock source the sbi0cr1 is used to specify the maximum transfer frequency for output on the scl pin in the master mode. set the baud rates, which have been calculated according to the formula below, to meet the specifications of the i 2 c bus, such as the smallest pulse width of t low . sbi0cr1 n 000 5 001 6 010 7 011 8 100 9 101 10 110 11 note1: f sbi shows f sys . note2: in a setup of prescaler of syscr0, the fc/16 mode cannot be used at the time of sbi circuit use. figure 3.10.12 clock source t high t low 1/fscl t low = 2 n ? 1 /f sbi t high = 2 n ? 1 /f sbi + 8/f sbi fscl = 1/(t low + t high ) f sbi 2 n + 8 =
tmp92cy23/cd23a 2009-08-28 92cy23-225 2. clock synchronization in the i 2 c bus mode, in order to wired-and a bus, a master device which pulls down a clock line to low level, in the first place, invalidate a clock pulse of another master device which generates a high-level clock pulse. the master device with a high-level clock pulse needs to detect the situation and implement the following procedure. the tmp92cy23/cd23a has a clock synchronization function for normal data transfer even when more than one master exists on the bus. the example explains the clock synchronization procedures when two masters simultaneously exist on a bus. figure 3.10.13 cloc k synchronization as master a pulls down the internal scl output to the low level at point ?a?, the scl line of the bus becomes the low level. after detecting this situation, master b resets a counter of high-lev el width of an own clock pulse and sets the internal scl output to the low level. master a finishes counting low-level width of an own clock pulse at point ?b? and sets the internal scl output to the high level. since master b holds the scl line of the bus at the low level, master a waits for counting high-level width of an own clock pulse. after master b finishes counting low-level width of an own clock pulse at point ?c? and master a detects the scl line of the bus at the high level, and starts counting high level of an own clock pulse. the clock pulse on the bus is determined by the master device with the shortest high-level width and the master device with the longest low-level width from among those master devices connected to the bus. (4) slave address and address re cognition mode specification when this device is to be used as a sl ave device, set the slave address and in i2c0ar. clear the to ?0? for the address recognition mode. (5) master/slave selection set the sbi0cr2 to ?1? for operating the tmp92cy23/cd23a as a master device. clear the sbi0cr2 to ?0? for operation as a slave device. the is cleared to ?0? by the hardware after a stop condition on the bus is detected or arbitration is lost. start couting high-level width of a clock pulse internal scl output (master a) internal scl output (master b) scl pin wait counting high-level width of a clock pulse reset a counter of high-level width of a clock pulse abc
tmp92cy23/cd23a 2009-08-28 92cy23-226 (6) transmitter/receiver selection set the sbi0cr2 to ?1? for operating the tmp92cy23/cd23a as a transmitter. clear the to ?0? for operation as a receiver. in slave mode, when transfer data in addressing format, when received slave address is same value with setting value to i2c0ar, or general call is received (all 8-bit data are ?0? after a start condition), the is set to ?1? by the hardware if the direction bit (r/ w ) sent from the master device is ?1?, and is cleared to ?0? by the hardware if the bit is ?0?. in the master mode, after an acknowledge signal is returned from the slave device, the is cleared to ?0? by the hardware if a transmitted direction bit is ?1?, and is set to ?1? by the hardware if it is ?0?. wh en an acknowledge signal is not returned, the current condition is maintained. the is cleared to ?0? by the hardware after a stop condition on the bus is detected or arbitration is lost. (7) start/stop condition generation when the sbi0sr = ?0?, slave address and dire ction bit which are set to sbi0dbr is output on the bus after generating a start condition by writing ?1111? to the sbi0cr2. it is nece ssary to set transmitted data to the data buffer register (sbi0dbr) and set ?1? to the beforehand. figure 3.10.14 start condition generation and slave address generation when the sbi0sr = ?1?, the sequence for generating a stop condition can be initiated by writing ?111? to the sbi0cr2 and writing ?0? to the sbi0cr2. do not modify the contents of the sbi0cr2 until a stop condition has been generated on the bus. figure 3.10.15 stop condition generation the state of the bus can be ascertained by reading the contents of sbi0sr. sbi0sr will be set to ?1? (bus busy status) if a start condition has been detected on the bus, and will be cleared to ?0? if a stop condition has been detected (bus free status). in addition, since there is a restrictions matter about stop condition generating in master mode, please refer to 3.10. 6. (4) ?stop condition generation?. 1 2 34567 8 9 a6 a5 a4 a3 a2 a1 a0 r/ w slave address and the direction bit a cknowledge signal start condition scl pin sda pin scl line sda line stop condition
tmp92cy23/cd23a 2009-08-28 92cy23-227 (8) interrupt service requests and interrupt cancellation when a serial bus interface interrupt request 0 (intsbe0) occurs, the sbi0sr2 is cleared to ?0?. during the time that the sbi0sr2 is ?0?, the scl line is pulled down to the low level. the is cleared to ?0? when end of transmission or receiving 1 word of data. and when writing data to sbi0dbr or reading data from sbi0dbr, is set to ?1?. the time from the being set to ?1? until the scl line is released takes t low . in the address recognition mode ( = ?0?), is cleared to ?0? when the received slave address is the same as the value set at the i2c0ar or when a general call is received (all 8-bit data are ?0? after a start condition). although sbi0cr2 can be set to ?1? by the program, the is not clear it to ?0? when it is programmed ?0?. (9) serial bus interface operation mode selection the sbi0cr2 is used to specify the serial bus interface operation mode. set the sbi0cr2 to ?10? when the device is to be used in i 2 c bus mode after confirming pin condition of serial bus interface to ?h?. switch a mode to port after confirming a bus is free. (10) arbitration lost detection monitor since more than one master device can exist simultaneously on the bus in i 2 c bus mode, a bus arbitration procedure has been implemented in order to guarantee the integrity of transferred data. data on the sda pin is used for i 2 c bus arbitration. the following example illustrates the bus arbitration procedure when there are two master devices on the bus. master a and master b output the same data until point ?a?. after master a outputs ?l? and master b, ?h?, the sda pin of the bus is wire-and and the sda pin is pulled down to the low level by master a. when the scl pin of the bus is pulled up at point ?b?, the slave device reads the data on the sda pin, that is, data in master a. data transmitted from master b becomes invalid. the master b state is known as ?arbitration lost?. master b device which loses arbitration releases the internal sda output in order not to affect data transmitted from other masters with arbitration. when more than one mast er sends the same data at the first word, arbitration occurs continuous ly after the second word. figure 3.10.16 arbitration lost internal sda output becomes ?1? after arbitration has been lost. scl pin internal sda output (master a) internal sda output (master b) sda pin ab
tmp92cy23/cd23a 2009-08-28 92cy23-228 the tmp92cy23/cd23a compares the levels on the bus?s sda line with those of the internal sda output on the rising edge of the scl line. if the levels do not match, arbitration is lost and sbi0sr is set to ?1?. when sbi0sr is set to ?1?, sbi0sr are cleared to ?00? and the mode is switched to slave receiver mode. thus, clock output is stopped in data transfer after setting = ?1?. sbi0sr is cleared to ?0? when data is written to or read from sbi0dbr or when data is written to sbi0cr2. figure3.10.17 example of a master device b (d7a = d7b, d6a = d6b) (11) slave address match detection monitor sbi0sr operates following in during slave mode; in address recognition mode (e.g., when i2c0ar = ?0?), when received ge neral call or same slave address with value set to i2c0ar, sbi0 sr is set to ?1?. when = ?1?, sbi0sr is set to ?1? after the fi rst word of data has been received. sbi0sr is cleared to ?0? when data is written to sbi0dbr or read from sbi0dbr. (12) general call detection monitor sbi0sr operates following in during slave mode; when received general call (all 8-bit data is ?0?, after a start condition), sbi0sr is set to ?1?. and sbi0sr is cleared to ?0? when a start condition or stop condition on the bus is detected. (13) last received bit monitor the value on the sda line detected on the rising edge of the scl line is stored in the sbi0sr. in the acknowledge mode, immediately after an intsbe0 interrupt request has been generated, an acknowledge si gnal is read by reading the contents of the sbi0sr. stop the clock pulse 1 keep internal sda output to high level as losing arbitration a ccessed to sbi0dbr or sbi0cr2 internal scl output internal sda output internal sda output internal scl output master a master b 2 3456789 1 2 34 d7a d6b d5a d4a d3a d2a d1a d0a d7a? d6a? d5a? d4a? 1 2 3 4 d7b d6a
tmp92cy23/cd23a 2009-08-28 92cy23-229 (14) software reset function the software reset function is used to init ialize the sbi circuit, when sbi is rocked by external noises, etc. when write first ?10? next ?01? to sbi0cr 2, reset signal is inputted to serial bus interface circuit, and circuit is initialized. all command registers except sbi0cr2 and status flag except sbi0cr2 are initialized to value of just after reset. sbi0cr1 is set to ?1? automatically when completed initialization of serial bus interface. (15) serial bus interface data buffer register (sbi0dbr) the received data can be read and transmi ssion data can be written by reading or writing sbi0dbr. in the master mode, after the slave address and the direction bit are set in this register, the start condition is generated. (16) i 2 c bus address register (i2c0ar) i2c0ar is used to set the slave address when the tmp92cy23/cd23a functions as a slave device. the slave address outputted from the master device is recognized by setting the i2c0ar to ?0?. and, the data format becomes the addressing format. when set to ?1?, the slave address is not re cognized, the data format becomes the free data format. (17) baud rate register (sbi0br1) write ?1? to baud rate circuit control register sbi0br1 before using i 2 c bus. (18) setting register for idle2 mode operation (sbi0br0) sbi0br0 is the register setting operation/stop during idle2 mode. therefore, setting is necessary before the halt instruction is executed.
tmp92cy23/cd23a 2009-08-28 92cy23-230 3.10.6 data transfer in i 2 c bus mode (1) device initialization in first, set the sbi0br1, sbi0 cr1. set sbi0br1 to ?1? and clear bits 7 to 5 and 3 in the sbi0cr1 to ?0?. next, set a slave address and the ( = ?0? when an addressing format) to the i2c0ar. and, write ?000? to sbi0cr2, ?1? to , ?10? to and ?00? to . set initialization status to slave receiver mode by this setting. (2) start condition generation and slave address generation 1. master mode in the master mode, the start condition and the slave address are generated as follows. in first, check a bus free status (when sbi0sr = ?0?). set the sbi0cr1 to ?1? (acknowledge mode) and specify a slave address and a direction bit to be transmitted to the sbi0dbr. when sbi0sr = ?0?, the start condition are generated by writing ?1111? to sbi0cr2. subsequently to the start condition, nine clocks are output from the scl pin. while eight clocks are output, the slave address and the direction bit which are set to the sbi0dbr. at the 9th clock, the sda line is released and the acknowledge signal is received from the slave device. an intsbe0 interrupt request generate at the falling edge of the 9th clock. the is cleared to ?0?. in the master mode, the scl pin is pulled down to the low level while is ?0?. when an in terrupt request is generated, the is changed according to the direction bit only when an acknowledge signal is returned from the slave device. 2. slave mode in the slave mode, the start condition and the slave address are received. after the start condition is received from the master device, while eight clocks are output from the scl pin, the slave address and the direction bit that are output from the master device are received. when a general call or the same address as the slave address set in i2c0ar is received, the sda line is pulled down to the low level at the 9th clock, and the acknowledge signal is output. an intsbe0 interrupt request is generated on the falling edge of the 9th clock. the is cleared to ?0?. in slave mode the scl line is pulled down to the low level while the = ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-231 figure3.10.18 start condition generation and slave address transfer (3) 1-word data transfer check the by the intsbe0 interrupt process after the 1-word data transfer is completed, and determine whether the mode is a master or slave. 1. if = ?1? (master mode) check the and determine whether the mode is a transmitter or receiver. when the = ?1? (transmitter mode) check the . when is ?1?, a receiver does not request data. implement the process to generate a stop condition (refer to (4)) and terminate data transfer. when the is ?0?, the receiver is requests new data. when the next transmitted data is 8 bits, write the transmitted data to sbi0dbr. when the next transmitted data is other than 8 bits, set the and write the transmitted data to sbi0dbr. after written the data, becomes ?1?, a serial clock pulse is generated for transferring a new 1-word of data from the scl0 pin, and then the 1-word data is transmitted. after the data is transmitted, an intsbe0 interrupt re quest generates. the becomes ?0? and the scl0 line is pulled down to the low level. if the data to be transferred is more than one word in length, repeat the procedure from the checking above. figure3.10.19 example in which = ?000? and = ?1? in transmitter mode 1 2 345678 9 a6 a5 a4 a3 a2 a1 ack r/ w slave address + direction bit a cknowledge signal from a slave device start condition scl pin sda pin intsbe0 interrupt request output of master output of slave a0 1 2 345678 9 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal from a receiver write to sbi0dbr scl pin sda pin intsbe0 interrupt request ack output from master output from slave
tmp92cy23/cd23a 2009-08-28 92cy23-232 when the is ?0? (receiver mode) when the next transmitted data is other than 8 bits, set and read the received data from sbi0dbr to release the scl0 line (data which is read immediately after a slave address is se nt is undefined). after the data is read, becomes ?1?. serial clock pulse fo r transferring new 1 word of data is defined scl and outputs ?l? level from sda0 pin with acknowledge timing. an intsbe0 interrupt request then generates and the becomes ?0?, then the tmp92cy23/cd23a pulls down the scl pin to the low level. the tmp92cy23/cd23a outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that rece ived data is read from the sbi0dbr. figure3.10.20 example of when = ?000?, = ?1? in receiver mode in order to terminate the transmission of data to a transmitter, clear to ?0? before reading data which is 1 word before the last data to be received. the last data word does not generate a clock pulse as the acknowledge signal. after the data has been transmitted and an interrupt request has been generated, set to ?001? and read the data. the tmp92cy23/cd23a generates a clock pulse for a 1-bit data transfer. since the master device is a receiver, the sda0 line on the bus remains high. the transmitter receives the high signal as an ack signal. the receiver indicates to the transmitter that the data transfer is completed. after the one data bit has been received and an interrupt request has been generated, the tmp92cy23/cd23a generate s a stop condition (see section (4)) and terminates data transfer. figure3.10.21 termination of data transfer in master receiver mode 1 2 3 45678 1 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal sent to a transmitter scl pin sda pin intsbe0 interrupt request ?001? read sbi0dbr ?0? read sbi0dbr 9 output of master output of slave 1 2 3 45678 9 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal to a transmitter read sbi0dbr scl pin sda pin intsbe0 interrupt request new d7 output from master output from slave ack
tmp92cy23/cd23a 2009-08-28 92cy23-233 2. when the is ?0? (slave mode) in the slave mode the tmp92cy23/cd23a operates either in normal slave mode or in slave mode after losing arbitration. in the slave mode, an intsbe0 interrupt request generate when the tmp92cy23/cd23a receives a slave address or a general call from the master device, or when a general call is received and data transfer is completed, or after matching received address. in the master mode, the tmp92cy23/cd23a operates in a slave mode if it losing arbitration. an intsbe0 interrupt request is generated when a word data transfer terminates after losing arbitration. when an intsbe0 interrupt request is generated the is cleared to ?0? and the scl pin is pu lled down to the low level. either reading/writing from/to the sbi0dbr or setting the to ?1? will release the scl pin after taking t low time. check the sbi0sr, , < aas>, and and implements processes according to conditions listed in the next table.
tmp92cy23/cd23a 2009-08-28 92cy23-234 table 3.10.1 operation in the slave mode conditions process 1 1 0 the tmp92cy23/cd23a detects arbitration lost when transmitting a slave address, and receives a slave address for which the value of the direction bit sent from another master is ?1?. 1 0 in slave receiver mode, the tmp92cy23/cd23a receives a slave address for which the value of the direction bit sent from the master is ?1?. set the number of bits of single word to , and write the transmit data to sbi0dbr. 1 0 0 0 in salve transmitter mode, transmission of data of single word is terminated. check the , if is set to ?1?, set to ?1?, reset ?0? to and release the bus for the receiver no request next data. if was cleared to ?0?, set bit number of single word to and write the transmit data to sbi0dbr for the receiver requests next data. 1 1/0 the tmp92cy23/cd23a detects arbitration lost when transmitting a slave address, and receives a slave address or general call for which the value of the direction bit sent from another master is ?0?. 1 0 0 the tmp92cy23/cd23a detects arbitration lost when transmitting a slave address or data, and transfer of word terminates. 1 1/0 in slave receiver mode the tmp92cy23/cd23a receives a slave address or general call for which the value of the direction bit sent from the master is ?0?. read the sbi0dbr for setting the to ?1? (reading dummy data) or set the to ?1?. 0 0 0 1/0 in slave receiver mode the tmp92cy23/cd23a terminates receiving word data. set bit number of single word to , and read the receiving data from sbi0dbr.
tmp92cy23/cd23a 2009-08-28 92cy23-235 (4) stop condition generation when sbi0sr = ?1?, the sequence for generating a stop condition is started by writing ?111? to sbi0cr2 and ?0? to sbi0cr2. do not modify the contents of sbi0cr2 until a stop condition has been generated on the bus. when the bus?s scl line has been pulled low by another device, the tmp92cy23/cd23a generates a stop condition when the other device has released the scl line and sda0 pin rising. figure3.10.22 stop condition generation (single master) figure3.10.23 stop condition generation (multi master) internal scl sda0 pin (read) stop condition ?1? ?1? ?0? ?1? scl0 pin the case of pulled low by another device scl0 pin sda0 pin (read) stop condition ?1? ?1? ?0? ?1? internal scl
tmp92cy23/cd23a 2009-08-28 92cy23-236 (5) restart restart is used during data transfer between a master device and a slave device to change the data transfer direction. the following description explains how to restart when this device is in the master mode. clear the sbi0cr2 to ?000? and set the sbi0cr2 to ?1? to release the bus. the sda0 line remains the high level and the scl0 pin is released. since a stop condition is not generated on th e bus, other devices a ssume the bus to be in a busy state. check the sbi0sr until it becomes ?0? to check that the scl0 pin of this device is released. check the until it becomes ?1? to check that the scl line on a bus is not pulled down to the low level by other devices. after confirming that the bus stays in a free state, generate a start condition with procedure described in (2). in order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to conf irm that the bus is free until the time to generate the start condition. figure 3.10.24 timing diagram when restarting start condition scl line internal scl output sda line 4.7 s (min) ?0? ?0? ?0? ?1? ?1? ?1? ?1? ?1?
tmp92cy23/cd23a 2009-08-28 92cy23-237 3.10.7 clocked-synchronous 8-bit sio mode control the following registers are used to control and monitor the operation status when the serial bus interface (sbi) is being operated in clocked-synchronous 8-bit sio mode. serial bus interface 0 control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 sck2 sck1 sck0 sbi0cr1 (1240h) read/write w w reset state 0 0 0 0 0 0 0 a read-modify- write operation cannot be performed. function transfer start 0: stop 1: start continue/ abort transfer 0: continue transfer 1:abort transfer transfer mode select 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode serial clock selection and reset monitor internal serial clock selection at write 000 n = 4 2.5 mhz 001 n = 5 1.25 mhz system clock: f sys 010 n = 6 625.0 khz f sys = 20 mhz 011 n = 7 312.5 khz (internal scl output) 100 n = 8 156.3 khz 101 n = 9 78.1 khz f sys 2 110 n = 10 39.1 khz f scl = 2 n [hz] 111 ? external clock: sck0 transfer mode selection 00 8-bit transmit mode 01 (reserved) 10 8-bit transmit/receive mode 11 8-bit receive mode continue/abort transfer 0 continue transfer 1 abort transfer (automatically cleared after transfer aborted) indicate transfer start/stop 0 stop 1start note: set the transfer mode and the serial clock a fter setting to ?0? and to ?1?. serial bus interface 0 data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 read/write r (receiver)/w (transfer) sbi0dbr (1241h) a read-modify- write operation cannot be performed. reset state undefined figure 3.10.25 register for the sio mode (sbi0)
tmp92cy23/cd23a 2009-08-28 92cy23-238 serial bus interface 1 control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 sck2 sck1 sck0 sbi1cr1 (1248h) read/write w w reset state 0 0 0 0 0 0 0 a read-modify- write operation cannot be performed. function transfer start 0: stop 1: start continue/ abort transfer 0:continue transfer 1:abort transfer transfer mode select 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode serial clock selection and reset monitor internal serial clock selection at write 000 n = 4 2.5 mhz 001 n = 5 1.25 mhz system clock: fsys 010 n = 6 625.0 khz f sys = 20 mhz 011 n = 7 312.5 khz (internal scl output) 100 n = 8 156.3 khz 101 n = 9 78.1 khz f sys 2 110 n = 10 39.1 khz f scl = 2n [hz] 111 ? external clock: sck1 transfer mode selection 00 8-bit transmit mode 01 (reserved) 10 8-bit transmit/receive mode 11 8-bit receive mode continue/abort transfer 0 continue transfer 1 abort transfer (automatically cleared after transfer aborted) indicate transfer start/stop 0 stop 1start note: set the transfer mode and the serial clock a fter setting to ?0? and to ?1?. serial bus interface 0 data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 read/write r (receiver)/w (transfer) sbi1dbr (1248h) a read-modify- write operation cannot be performed. reset state undefined figure 3.10.26 register for the sio mode (sbi1)
tmp92cy23/cd23a 2009-08-28 92cy23-239 serial bus interface 0 control register 2 7 6 5 4 3 2 1 0 bit symbol sbim1 sbim0 ? ? sbi0cr2 (1243h) read/write w reset state 0 0 0 0 a read-modify- write operation cannot be performed function serial bus interface operation mode selection 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) always write ?0?. always write ?0?. serial bus interface operation mode selection 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) serial bus interface 0 status register 7 6 5 4 3 2 1 0 bit symbol siof sef sbi0sr (1243h) read/write r reset state 0 0 function serial transfer operation status monitor shift operation status monitor serial transfer operating status mo nitor shift operation status monitor 0 transfer terminated 0 shift operation terminated 1 transfer in progress 1 shift operation in progress serial bus interface 0 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol ? i2sbi0 sbi0br0 (1244h) read/write w r/w reset state 0 0 function always write ?0?. idle2 0: stop 1: operate operation in idle mode 0 stop 1 operate serial bus interface 0 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4en ? read/write w reset state 0 0 sbi0br1 (1245h) a read-modify -write operation cannot be performed function internal clock 0: stop 1: operate always write ?0?. baud rate clock control 0 stop 1 operate figure 3.10.27 registers for the sio mode (sbi1) note 1: set the sbi0cr1 ?000? before switching to a clocked-synchronous 8-bit sio mode. note 2: please always write ?00? to sbicr2<1:0>. note: clocked-synchronous mode cannot operate in idle2 mode. a read-modify- write operation cannot be performed
tmp92cy23/cd23a 2009-08-28 92cy23-240 serial bus interface 1 control register 2 7 6 5 4 3 2 1 0 bit symbol sbim1 sbim0 ? ? sbi1cr2 (124bh) read/write w reset state 0 0 0 0 a read-modify- write operation cannot be performed. function serial bus interface operation mode selection 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) always write ?0?. always write ?0?. serial bus interface operation mode selection 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) serial bus interface 1 status register 7 6 5 4 3 2 1 0 bit symbol siof sef sbi1sr (124bh) read/write r reset state 0 0 function serial transfer operation status monitor shift operation status monitor serial transfer operating status monitor shift operation status monitor 0 transfer terminated 0 shift operation terminated 1 transfer in progress 1 shift operation in progress serial bus interface 1 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol ? i2sbi1 sbi1br0 (124ch) read/write w r/w reset state 0 0 a read-modify- write operation cannot be performed. function always write ?0?. idle2 0: stop 1: operate operation in idle mode 0 stop 1 operate serial bus interface 1 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4en ? read/write w reset state 0 0 sbi1br1 (124dh) a read-modify- write operation cannot be performed. function internal clock 0: stop 1: operate always write ?0?. baud rate clock control 0 stop 1 operate figure 3.10.28 registers for the sio mode (sbi1) note 1: set the sbi1cr1 ?000? before switching to a clocked-synchronous 8-bit sio mode. note 2: please always write ?00? to sbicr2<1:0>. note: clocked-synchronous mode cannot operate in idle2 mode.
tmp92cy23/cd23a 2009-08-28 92cy23-241 (1) serial clock 1. clock source sbi0cr1 is used to se lect the following functions: internal clock in an internal clock mode, any of seven frequencies can be selected. the serial clock is output to the outside on the sck pin. when the device is writing (in the transmit mode) or reading (in the receive mode) data cannot follow the serial clock rate, an automatic wait function is executed to stop the serial clock automatically and holds the next shift operation until reading or writing is complete. figure 3.10.29 automatic wait function external clock ( = ?111?) an external clock input via the sck pin is used as the serial clock. in order to ensure the integrity of shift operations, both the high and low-level serial clock pulse widths shown below must be ma intained. the maximum data transfer frequency is 1.25 mhz (when f sys = 20 mhz). figure 3.10.30 maximum data transfer frequency when external clock input a 0 3 sck0 pin output 12 78 2 1 6 7 8 1 2 3 so0 pin output a 1 a 5 a 2 a 6 a 7 b 0 b 4 b 1 b 5 b 6 b 7 c 0 c 1 c 2 write transmitted data a b c automatic wait function t sckl sck0 pin t sckl , t sckh > 4/f sys t sckh
tmp92cy23/cd23a 2009-08-28 92cy23-242 2. shift edge data is transmitted on the leading edge of the clock and received on the trailing edge. (a) leading edge shift data is shifted on the leading edge of the serial clock (on the falling edge of the sck pin input/output). (b) trailing edge shift data is shifted on the trailing edge of the serial clock (on the rising edge of the sck pin input/output). figure 3.10.31 shift edge ******** sck pin output so pin output bit0 bit1 bit7 shift register 76543210 * 7654321 ** 765432 *** 76543 **** 7654 ***** 765 ****** 76 ******* 7 (a) leading edge sck pin si pin shift register 0 ******* 10 ****** 210 ***** 3210 **** 43210 *** 543210 ** 6543210 * 76543210 (b) trailing edge *: don?t care bit2 bit3 bit4 bit5 bit6 bit0 bit1 bit7 bit2 bit3 bit4 bit5 bit6
tmp92cy23/cd23a 2009-08-28 92cy23-243 (2) transfer modes the sbi0cr1 is used to select a transmit, receive or transmit/receive mode. 1. 8-bit transmit mode set a control register to a transmit mode and write transmission data to the sbi0dbr. after the transmit data has been written, set the sbi0cr1 to ?1? to start data transfer. the transmitted data is transferred from the sbi0dbr to the shift register and output, starting with the least significant bit (lsb), via the so pin and synchronized with the serial clock. when the transmission data has been transferred to the shift register, the sbi0dbr becomes empty. the intsbe0 (buffer empty) interrupt request is generated to request new data. when the internal clock is used, the serial clock will stop and the automatic wait function will be initiated if new data is not loaded to the data buffer register after the specified 8-bit data is transmitted. when new transmission data is written, the automatic wait function is canceled. when the external clock is used, data should be written to the sbi0dbr before new data is shifted. the transfer speed is determined by the maximum delay time between the time when an interrupt request is generated and the time when data is written to the sbi0dbr by the interrupt service program. when the transmit is started, after the sbi0sr goes ?1? output from the so pin holds final bit of the last data until falling edge of the sck. data transmission ends when the is cleared to ?0? by the intsbe0 interrupt service program or when the is set to ?1?. when the is cleared to ?0?, the transmitted mode en ds when all data is output. in order to confirm whether data is being transmitte d properly by the program, the (bit3 of the sbi0sr) to be sensed. the sbi0sr is cleared to ?0? when transmission has been comple ted. when the is set to ?1?, transmitting data stops. the turns ?0?. when the external clock is used, it is also necessary to clear the to ?0? before new data is shifted; otherwise, dummy data is transmitted and operation ends.
tmp92cy23/cd23a 2009-08-28 92cy23-244 figure 3.10.32 transfer mode example: program to stop data transmission (when an external clock is used) stest1: bit 2, (sbi0sr) ; if = ?1? then loop jr nz, stest1 stest2: bit 0, (pn) ; if sck0 = ?0? then loop jr z, stest2 ld (sbi0cr1), 00000111b ; ?0? (b) external clock clear sck0 pin (input) write transmitted data so0 pin intsbe0 interrupt request sbi0dbr b b 7 * (a) internal clock a 2 a 1 a 4 a 3 a 6 a 5 b 0 a 7 b 2 b 1 b 4 b 3 b 6 b 5 a 0 clear sck0 pin (output) a write transmitted data so0 pin intsbe0 interrupt request sbi0dbr b 7 * a 2 a 1 a 4 a 3 a 6 a 5 b 0 a 7 b 2 b 1 b 4 b 3 b 6 b 5 a 0 b a
tmp92cy23/cd23a 2009-08-28 92cy23-245 figure 3.10.33 transmitted data hold time at end of transmission 2. 8-bit receive mode set the control register to receive mode and set the sbi0cr1 to ?1? for switching to receive mode. data is received into the shift register via the si pin and synchronized with the serial clock, starting from the least significant bit (lsb). when the 8-bit data is received, the data is transferred from the shift register to the sbi0dbr. the intsbe 0 (buffer full) interrupt request is generated to request that the received data be read. the data is then read from the sbi0dbr by the interrupt service program. when the internal clock is used, the serial clock will stop and the automatic wait function will be in effect until the received data is read from the sbi0dbr. when the external clock is used, since shift operation is synchronized with an external clock pulse, the received data should be read from the sbi0dbr before the next serial clock pulse is input. if the received data is not read, further data to be received is canceled. the maximum transfer speed when an external clock is used is determined by the delay time be tween the time when an interrupt request is generated and the time when the received data is read. receiving of data ends when the is cleared to ?0? by the intsbe0 interrupt service program or when the is set to ?1?. if is cleared to ?0?, received data is transf erred to the sbi0dbr in complete blocks. the received mode ends when the transfer is complete. in order to confirm whether data is being received properly by the program, the sbi0sr to be sensed. the is cleared to ?0? when receiving is complete. when it is confirmed that receiving has been completed, the last data is read. when the is set to ?1?, data receiving st ops. the is cleared to ?0?. (the received data becomes invalid, th erefore no need to read it.) note: when the transfer mode is changed, the contents of the sbi0dbr will be lost. if the mode must be changed, conclude data receiving by cleari ng the to ?0?, read the last data, then change the mode. sck0pin bit7 bit6 so0 pin t sodh = 3.5/f fph [s] (min)
tmp92cy23/cd23a 2009-08-28 92cy23-246 figure 3.10.34 receiver mode (example: internal clock) 3. 8-bit transmit/receive mode set a control register to a transmit/recei ve mode and write data to the sbi0dbr. after the data is written, set the sbi0cr to ?1? to start transmitting/receiving. when data is transmitted, the data is output from the so0 pin, starting from the least signific ant bit (lsb) and synchronized with the leading edge of the serial clock signal. when data is received, the data is input via the si pin on the trailing edge of the seri al clock signal. 8-bit data is transferred from the shift register to the sbi0dbr and the intsbe0 interrupt request is generated. the interrupt service program reads the received data from the data buffer register and writes the data which is to be transmitted. the sbi0dbr is used for both transmitting and receiving. transmitted data should always be written after received data is read. when the internal clock is used, the auto matic wait function will be in effect until the received data is read and the next data is written. when the external clock is used, since the shift operation is synchronized with the external clock, the received data is read and transmitted data is written before a new shift operation is executed. the maximum transfer speed when the external clock is used is determined by the delay time between the time when an interrupt request is generated and the time at whic h received data is read and transmitted data is written. when the transmit is started, after the sbi0sr goes ?1? output from the so pin holds final bit of the last data until falling edge of the sck. transmitting/receiving data ends when the is cleared to ?0? by the intsbe0 interrupt service program or when the sbi0cr1 is set to ?1?. when the is cleared to ?0?, receiv ed data is transferred to the sbi0dbr in complete blocks. the transmit/receive mode ends when the transfer is complete. in order to confirm whether data is being transmitted/received properly by the program, set the sbi0sr to be sensed. the is set to ?0? when transmitting/receiving is completed. when the is set to ?1?, data transmitting/receiving stops. the is then cleared to ?0?. note: when the transfer mode is changed, the contents of the sbi0dbr will be lost. if the mode must be changed, conclude data transmitting/receiving by clearing the to ?0?, read the last data, then change the transfer mode. b b 7 a 2 a 1 a 4 a 3 a 6 a 5 b 0 a 7 b 2 b 1 b 4 b 3 b 6 b 5 a 0 clear sck pin (output) a read receiver data si pin intsbe0 interrupt request sbi0dbr read receiver data
tmp92cy23/cd23a 2009-08-28 92cy23-247 figure 3.10.35 transmit/received mode (example: internal clock) figure 3.10.36 transmitted data hold time at end of transmit/receive * a 7 d b 7 a 2 a 1 a 4 a 3 a 6 a 5 b 0 b 2 b 1 b 4 b 3 b 6 b 5 a 0 clear sck0 pin (output) b write transmitted data ( b ) so0 pin intsbe0 interrupt request sbi0dbr c 7 d 7 c 2 c 1 c 4 c 3 c 6 c 5 d 0 d 2 d 1 d 4 d 3 d 6 d 5 c 0 si0 pin c a read received data (c) write transmitted data ( a ) read received data (d) sck0 pin bit6 so0 pin t sodh = 4/f sys [s] (min) bit7 in last transmitted word
tmp92cy23/cd23a 2009-08-28 92cy23-248 3.11 high speed sio (hsc) multifunction high speed sio (hsc) for 1 chan nel is contained (note). hsc supports only the master mode in i/o interface mode (synchronous transmission). note: hsc circuit is not built into tmp92cy23. its features are summarized as follows: 1) double buffer (transmit/receive) 2) generates the crc-7 and crc-16 values for transmission and reception 3) baud rate : 10mbps (max) 4) selects the msb/lsb-first 5) selects the 8/16-bit data length 6) selects the clock rising/falling edge 7) one types of interrupt: inthsc select read/mask/clear interrupt/clear enable for 4 interrupts: rfr0 (receive buffer of hsc0rd: full), rfw0 (transmission buffer of hsc0td: empty), rend0 (receive buffer of hsc0rs: full), tend0 (transmission buff er of hsc0ts: empty). rfr0,rfw0 can be processed data at high-speeed by using micro dma. table 3.11.1 registers and pins for hsc hsc pin name hsso (pf3) hssi (pf4) hsclk (pf5) sfr (address) hsc0md (c00h/c01h) hsc0ct (c02h/c03h) hsc0st (c04h/c05h) hsc0cr (c06h/c07h) hsc0is (c08h/c09h) hsc0we (c0ah/c0bh) hsc0ie (c0ch/c0dh) hsc0ir (c0eh/c0fh) hsc0td (c10h/c11h) hsc0rd (c12h/c13h) hsc0ts (c14h/c15h) hsc0rs (c16h/c17h)
tmp92cy23/cd23a 2009-08-28 92cy23-249 3.11.1 block diagram figure 3.11.1 shows a block diagram of the hsc. f sys baud rate generator hsc0md/ct 16bits 16bits 16bits hsclk hsc0td hsc0ts transmitt,receive controller hsso 16bits hsc0rd hsc0rs hssi hsc0ie/is/we inthsc 16bits hsc0cr internal data bus hsc0st 16bits note : the hsso, hssi, hsclk pins are set to configur ed as input ports (ports pf3, pf4 and pf5) by upon reset. thus, these pins require pull-up resi stors to fix their voltage levels. figure 3.11.1 hsc block diagram
tmp92cy23/cd23a 2009-08-28 92cy23-250 3.11.2 sfr this section describes the sfrs of the hsc are as follows. these area connected to the cpu with 16 bit data buses. (1) mode setting register the hsc0md register specifies the operating mode, clock operation, etc. hsc0md register 7 6 5 4 3 2 1 0 bit symbol xen0 clksel02 clksel01 clksel00 read/write r/w r/w reset state 0 1 0 0 function sysck 0: disable 1: enable select baud rate 000: reserved 100: f sys /16 001: f sys /2 101: f sys /32 010: f sys /4 111: f sys /64 011: f sys /8 111:reserved hsc0md (0c00h) 15 14 13 12 11 10 9 8 bit symbol loopback0 msb1st0 dostat0 tcpol0 rcpol0 tdinv0 rdinv0 read/write r/w r/w reset state 0 1 1 0 0 0 0 (0c01h) function loopback test mode 0:disbale 1:enable start bit for transmission /reception 0:lsb 1:msb hsso0 pin when not transmitting 0:fixed to ?0? 1:fixed to ?1? synchroniza- tion clock edge select for transmission 0: falling edge 1: rising edge synchroniza- tion clock edge select for reception 0: fall 1: rise data inversion for transmission 0: disable 1: enable data inversion for reception 0: disable 1: enable figure 3.11.2 hsc0md register (a) the internal hsso output to be internally connected to the hssi input. this setup can be used for testing. also, a clock signal is generated from the hsclk pin, regardless of whether data transmission or reception is in progress when setting the xen0 and loopback0 bits to ?1? enables. data transmission or recept ion must not be performed while changing the state of this bit. figure 3.11.3 register function (b) this bit specifies whether to transmit/recei ve byte with the msb first or with the lsb first. data transmission or reception must not be performed while changing the state of this bit. y b hssi pin hsso pin transmitting data receiving data a s hsc0md
tmp92cy23/cd23a 2009-08-28 92cy23-251 (c) this bit specifies the status of the hsso pin of when data transmission is not performed (i.e., after completing data transmission or during data reception). data transmission or reception must not be performed while changing the state of this bit. (d) this bit specifies the polarity of the active edge of the synchronization clock for data transmission. the xen0 bit should be cleared to ?0? for ch anging the state of this bit. at the same time, rcpol0 should also be cleared to ?0?. figure 3.11.4 register function (e) this bit specifies the polarity of the active edge of the synchronization clock during for data reception. the bit should be cleared to ?0? for changing the state of this bit. tcpol0 should also be cleared to ?0?. figure 3.11.5 register function (f) this bit specifies whether to logically invert the data transmitted from the hsso pin or not. data transmission or reception must not be performed while changing the state of this bit. data which is inputted to crc calculation circuit is transmission data which is written to hsc0td. this input data is not corresponded to . is not corresponded to : it set condition of hsso pin when it is not transferred. (g) this bit specifies whether to logically invert the data received from the hssi pin or not. data transmission or reception must not be performed while changing the state of this bit. data which is inputted to crc calculation circuit is selected by . lsb hsclk pin (=?0?) hsso pin bit0 bit1 bit2 bit3 bit4 bit7 msb hsclk pin (=?1?) lsb hsclk pin (=?0?) hssi pin bit0 bit1 bit2 bit3 bit4 bit7 msb hsclk pin (=?1?)
tmp92cy23/cd23a 2009-08-28 92cy23-252 (h) this bit enables or disables the internal clock signal. (i) this bit selects the baud rate. the baud rate is generated using the system clock f sys and is programmable as shown below according to the system clock settings. data transmission or recept ion must not be performed while changing the state of these bits table 3.11.2 example of baud rate baud rate [mbps] f sys = 12mhz f sys = 16mhz f sys = 20mhz f sys /2 6 8 10 f sys /4 3 4 5 f sys /8 1.5 2 2.5 f sys /16 0.75 1 1.25 f sys /32 0.375 0.5 0.625 f sys /64 0.1875 0.25 0.3125
tmp92cy23/cd23a 2009-08-28 92cy23-253 (2) control register the hsc0ct register specifies data length, crc, etc. hsc0ct register figure 3.11.6 hsc0ct register (a) this bit selects the crc calculation algorithm from the crc7 and crc16. (b) this bit selects the data to be sent to the crc generator. (c) this bit is used to initialize the crc calculation register. this section describes how to calculate the crc16 of the transmit data and to append the calculated crc value at the end of the transmit data. figure 3.11.7 below illustrates the fl ow chart of the crc calculation procedures. a. program the hsc0ct bit to select the crc algorithm from crc7 and crc16. then, also program the crcrx_tx_b bit to specify the data on which the crc calculation is performed. b. to reset the hsc0cr register, write ?0? to the crcreset_b bit and then write ?1? to the same bit. c. load the hsc0td register with the transmit data, and wait until transmission of all data is completed. d. read the hsc0cr register and obtain the result of the crc calculation. e. transmit the crc obtained in step (d) in the same way as step (c). the crc calculation on the receive data can be performed in the same procedures. 7 6 5 4 3 2 1 0 bit symbol ? ? unit160 algnen0 rxwen0 rxuen0 read/write r/w r/w reset state 0 1 0 0 0 0 function always write ?0?. always write ?1?. data length 0: 8 bits 1: 16 bits full duplex alignment 0: disable 1: enable sequential reception0: disable 1: enable receive unit 0: disable 1: enable hsc0ct (0c02h) 15 14 13 12 11 10 9 8 bit symbol crc16_7_b0 crcrx_tx_b0 crcreset_b0 dmaerfw0 dmaerfr0 read/write r/w r/w r/w reset state 0 0 0 0 0 (0c03h) function crc select 0: crc7 1: crc16 crc data 0: transmit 1: receive crc calculation register 0:reset 1: reset release micro dma 0: disable 1: enable micro dma 0: disable 1: enable
tmp92cy23/cd23a 2009-08-28 92cy23-254 figure 3.11.7 flow chart of t he crc calculation procedures (d) this bit sets the interrupt clearing usin g to unnecessary because be supported rfw0 interrupt to micro dma. if this bit is set to ?1?, it is set to one-shot interrupt, clearing interrupt by hsc0we register become to unnecessary. hsc0st flag generate 1-shot interrupt when change from ?0? to ?1?(rising). (e) this bit sets the interrupt clearing usin g cpu to unnecessary because be supported rfr0 interrupt to micro dma. if this bit is se t to ?1?, it is set to one-shot interrupt, clearing interrupt by hsc0we register become to unnecessary. hsc0st flag generate 1-shot interrupt when change from ?0? to ?1?(rising). (f) this bit selects the data length for transm ission and reception. the data length is hereafter referred to as the unit. data transmission or reception must not be performed while changing the state of this bit (g) this bit should be set to ?1? when performing the full-duplex communication. this bit specifies whether to align the transm it and receive data on the unit-size boundaries. data transmission or recept ion must not be performed while changing the state of this bit. start = ?1?, = ?0? = ?0? ?1? transmit all data read crc from hsc0cr write crc in hsc0td and send end
tmp92cy23/cd23a 2009-08-28 92cy23-255 (h) this bit enables or disables the sequential mode reception. (i) this bit enables or disables the unit mode reception. for = ?1?, this bit is disabled. data transmission or reception must not be performed while changing the state of this bit. [data transmission/reception modes] this hsc controller supports six operating modes as listed below. these are specified by the , , bits. table 3.11.3 transmit/receive operation mode bit settings operation mode description (1) unit transmission 0 0 0 transmit written data per unit (2) sequential transmission 0 0 0 transmit written data sequentially (3) unit reception 0 0 1 receive only one unit-size data (4) sequential reception 0 1 0 automatically receive data if buffer has any empty space (5) unit transmission and reception 1 0 1 transmit/receive one unit-size data with the addresses of transmit/receive data aligned on unit-size boundaries (6)sequential transmission and reception 1 1 0 transmit/receive data sequentially with the addresses of transmit/receive data aligned on unit-size boundaries
tmp92cy23/cd23a 2009-08-28 92cy23-256 difference between the unit-mode and sequential-mode transmission unit mode transmission transmits one-un it by writing data after confirming hsc0st = ?1?. in the sequential-mode transmission, transmit data written into the hsc0td is loaded sequentially. in hard ware, this mode of tran smission keeps transmitting data as long as the transmit data exists. this mode of transmission keeps transmitting data as long as the transmit data exists. therefore, the sequential-mode transmission continues as long as the next data is written to it when hsc0st = ?1?. unit-mode transmission and sequential-mode transmission depend on the way of using. hardware doesn?t depend on. figure 3.11.8 show flow chart of unit-mode transmission and sequential-mode transmission. figure 3.11.8 flow chart of unit-mod e tr ansmission and sequential-mode transmission y n n n y y n unit-mode transmission sequential-mode transmission y write transmission data to hsc0td does hsc0ts have space? hsc0st= ?1?? does hsc0td have space? hsc0st= ?1?? does hsc0td have space? hsc0st= ?1?? transmission all data end? transmission all data end? transmission end? hsc0st= ?1?? transmission end? hsc0st= ?1?? start transmission end transmission end y n n n y y write transmission data to hsc0td start
tmp92cy23/cd23a 2009-08-28 92cy23-257 differences between the unit-mode and sequential-mode receptions the unit-mode reception receives only one unit-size data. writing ?1? to the hsc0ct bit initiates a receive operation of one unit data. then, it is stored the received data into the receive data register (hsc0rd). reading the hsc0rd register after writing ?0? to the hsc0ct bit. if the hsc0rd register is read again when the hsc0ct bit is set to ?1?, one-unit data is additionally received. in hardware, this mode receives sequentially by single buffer. hsc0st is changed during unit receiving. the sequential-mode reception automatically receives the data as long as the receive buffer has any empty space. this mode of reception keeps receiving the ne xt data automatically unless the data receive buffer becomes full. therefore, the reception continues sequentially without stopping at every unit-sized reception by reading it after data is loaded in hsc0rd. in hardware, this mode receives sequentially by double buffer. figure 3.11.9 show flow chart of unit-re c e pt ion and sequential-mode reception.
tmp92cy23/cd23a 2009-08-28 92cy23-258 figure 3.11.9 flow chart of unit-mode reception and sequential-mode reception start program receive number -1 receiving end? end y n n y read receive data from hsc0rd receiving end? hsc0st = ?1?? n y write ?1? to hsc0ct write ?0? to hsc0ct read last receiving data from hsc0rd last receiving end? hsc0st= ?1?? start program receive number -2 receiving end? end y n n y read receiving data from hsc0rd n y write ?1? to hsc0ct write ?0? to hsc0ct read last receiving data from hsc0rd n y n y read second data from last from hsc0rd receiving end? hsc0st = ?1?? last second receiving end ? hsc0st= ?1?? last second receiving end ? hsc0st= ?1?? does last-data exist in hsc0rd? hsc0st = ?1?? unit-mode reception sequential-mode reception
tmp92cy23/cd23a 2009-08-28 92cy23-259 (3) interrupt , status register read of condition, mask of condition, clear interrupt and clear enable can control each 4 interrupts; rfr0 (hsc0rd receiving buffer is full), rfw0 (hsc0td transmission buffer is empty), rend0 (hsc0rs receiving buffer is full), tend0 (hsc0ts transmission buffer is empty). rfr0, rfw0 can high-speed transaction by micro dma. following is description of interrupt ? status (example rfw0). status register hsc0st show rfw0 (internal signal that show whether transmission data register exist or not). this register is ?0? when transmission data exist. this register is ?1? when transmission data doesn?t exist. it can read internal signal directly. therefore, it can confirm transmission data at any time. interrupt status register hsc0is is set by rising edge of rfw0. this register keeps that condition until write ?1? to this register and reset when hsc0we is ?1?. rfw0 interrupt generate when interrupt enable register hsc0ie is ?1?. when it is ?0?, interrupt is not generated. interrupt request register hsc0ir show whether interrupt is generating or not. interrupt status write enable register hsc0we set that enables reset for reset interrupts status register by mistake. circuit config of transmission data shift re gister (hsc0ts), receiv ing register (hsc0rd), receiving data shift register (hsc0r s) are same with above register. control register hsc0ct, hsc0ct is register for using micro dma. when micro dma transfer is executed by using rfw0 interrupt, set ?1? to , and when it is executed by using rfr0 interrupt, set ?1? to , and prohibit other interrupt. figure 3.11.10 figurer for interrupt, status interrupt enable register hsc0ie d q ck q s r interrupt status register hsc0is interrupt request register hsc0ir no transmit of tansmission data register (hsc0td) 0: exist data, 1:no data write ?1? d q ck interrupt status write enable register hsc0we status (tend0) of transmission data shift register (hsc0st) 0: exist data, 1: no data status (rfr0) of receiving data register (hsc0rd) 0: exist data, 1: no data status (rend0) of receiving data shift register (hsc0rs) 0: exist data, 1: no data control register hsc0ct control register hsc0ct status register hsc0st stattus (rfw0) of transmission data register (hsc0td): exist data:0, no data: 1 rising edge detection inthsc
tmp92cy23/cd23a 2009-08-28 92cy23-260 (3-1) status register this register contains four bits that in dicates the status of data communication. hsc0st register 7 6 5 4 3 2 1 0 bit symbol tend0 rend0 rfw0 rfr0 read/write r reset state 1 0 1 0 function receiving 0:operation 1: no operation receive shift register 0: no data 1: exist data transmit buffer 0:untransm -itted data exist 1: no untrans- mitted data receive buffer 0:no valid data 1: valid data exist hsc0st (0c04h) 15 14 13 12 11 10 9 8 bit symbol read/write reset state (0c05h) function figure 3.11.11 hsc0st register (a) this bit is cleared to ?0? when the transmit register (hsc0ts) contains valid data; otherwise, it is set to ?1?. (b) this bit is set to ?1? when completing the data reception and valid data is stored into the receive data register (if there is any valid data). this bit is cleared to ?0? when the receive register (hsc0rs) contains no valid data, or when the reception is in progress. it is cleared to ?0?, when cpu read the data and shift to receive read register. (c) after wrote the received data to receive data write register, shift the data to receive data shift register. this bit keeps ?0?until al l valid data has moved. and this bit is set to ?1? when it can accept the next data and contains no valid data. (d) this bit is set to ?1? when received data is shifted from received data shift register to received data read register and there is any valid data. it is set to ?0? when the data is read and contains no valid data.
tmp92cy23/cd23a 2009-08-28 92cy23-261 (3-2) interrupt status register this register is used for reading four interrupts status and clearing interrupts. this register is cleared to ?0? by writing ?1? to applicable bit. status of this register show interrupt source state. this register can conf irm changing of interrupt condition, even if interrupt enable register is masked. hsc0is register 7 6 5 4 3 2 1 0 bit symbol tendis0 rendis0 rfwis0 rfris0 read/write r / w reset state 0 0 0 0 function read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:nointerrupt 1:interrupt write 0:don?t care 1:clear hsc0is (0c08h) 15 14 13 12 11 10 9 8 bit symbol read/write reset state (0c09h) function figure 3.11.12 hsc0is register (a) this bit is used for reading the status of tend interrupt and clearing interrupt. if writing this bit, set ?1? to hsc0we. (b) this bit is used for reading the status of rend interrupt and clearing interrupt. if writing this bit, set ?1? to hsc0we. (c) this bit is used for reading the status of rfw interrupt and clearing interrupt. if writing this bit, set ?1? to hsc0we. (d) this bit is used for reading the status of rfr interrupt and clearing interrupt. if writing this bit, set ?1? to hsc0we.
tmp92cy23/cd23a 2009-08-28 92cy23-262 (3-3) interrupt status write enable register this register enables or disables the clearing status bit of four types of interrupts. hsc0we register 7 6 5 4 3 2 1 0 bit symbol tendwe0 rendwe0 rfwwe0 rfrwe0 read/write r / w reset state 0 0 0 0 function clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable hsc0we (0c0ah) 15 14 13 12 11 10 9 8 bit symbol read/write reset state (0c0bh) function figure 3.11.13 hsc0we register (a) this bit enables or disables clearing the hsc0is. (b) this bit enables or disables clearing the hsc0is. (c) this bit enables or disables clearing the hsc0is. (d) this bit enables or disables clearing the hsc0is.
tmp92cy23/cd23a 2009-08-28 92cy23-263 (3-4) interrupt enable register this register enables or disables the generation of four types of interrupts. hsc0ie register 7 6 5 4 3 2 1 0 bit symbol tendie0 rendie0 rfwie0 rfrie0 read/write r/w reset state 0 0 0 0 function tend0 interrupt 0: disable 1: enable rend0 interrupt 0: disable 1: enable rfw0 interrupt 0: disable 1: enable rfr0 interrupt 0: disable 1: enable hsc0ie (0c0ch) 15 14 13 12 11 10 9 8 bit symbol read/write reset state (0c0dh) function figure 3.11.14 hsc0ie register (a) this bit enables or disables the tend0 interrupt. (b) this bit enables or disables the rend0 interrupt. (c) this bit enables or disables the rfw0 interrupt. (d) this bit enables or disables the rfr0 interrupt.
tmp92cy23/cd23a 2009-08-28 92cy23-264 (3-5) interrupt request register this register is used for showing ge neration condition for 4 interrupts. this register is set to the reading ?0? (inte rrupt doesn?t generate) always when interrupt enable register is masked. hsc0ir register 7 6 5 4 3 2 1 0 bit symbol tendir0 rendir0 rfwir0 rfrir0 read/write r reset state 0 0 0 0 function tend0 interrupt 0: none 1:generate rend0 interrupt 0: none 1:generate rfw0 interrupt 0: none 1:generate rfr0 interrupt 0: none 1:generate hsc0ir (0c0eh) 15 14 13 12 11 10 9 8 bit symbol read/write reset state (0c0fh) function figure 3.11.15 hsc0ir register (a) this bit is used for showing the condition of tend0 interrupt generation. (b) this bit is used for showing the condition of rend0 interrupt generation. (c) this bit is used for showing the condition of rfw0 interrupt generation. (d) this bit is used for showing the condition of rfr0 interrupt generation.
tmp92cy23/cd23a 2009-08-28 92cy23-265 (4) hsc0cr (hsc0 crc register) this register contains the crc calculation result for transmit/receive data. hsc0cr register 7 6 5 4 3 2 1 0 bit symbol crcd007 crcd006 crcd005 crcd004 crcd003 crcd002 crcd001 crcd000 read/write r reset state 0 0 0 0 0 0 0 0 function crc calculation result load register [7:0] hsc0cr (0c06h) 15 14 13 12 11 10 9 8 bit symbol crcd015 crcd014 crcd013 crcd012 crcd011 crcd010 crcd009 crcd008 read/write r reset state 0 0 0 0 0 0 0 0 (0c07h) function crc calculation result load register [15:8] figure 3.11.16 hsc0cr register (a) the crc result which is calculated according to the settings of the crc16_7_b0, crcrx_tx_b0 and crcreset_b0 bits in the hsc0ct register are loaded into this register. when using the crc16 algorithm, all the bits participate in the crc generation. when using the crc7 algorithm, only the lower seven bits participates in the crc generation. the following describes the steps required to calculate the crc16 for the transmit data. first, initialize the crc calculation register by writing ?1? to the crcreset_b0 bit after programming three bits as follows: crc16_7_b0 = ?1?, crcrx_tx_b0 = ?0?, and crcreset_b0 = ?0?. then, by writing the transmit data into the hsc0td register, complete the transmission of all bits, for which the crc should be calculated. the hsc0st bit should be checked to confirm whether the reception is completed. by reading the hsc0cr register after the transmission is completed, the crc16 for the transmit data can be obtained.
tmp92cy23/cd23a 2009-08-28 92cy23-266 (5) transmit data register this register is used for writing the transmit data. hsc0td register 7 6 5 4 3 2 1 0 bit symbol txd007 txd006 txd005 txd004 txd003 txd002 txd001 txd000 read/write r/w reset state 0 0 0 0 0 0 0 0 function transmit data bits [7:0] hsc0td (0c10h) 15 14 13 12 11 10 9 8 bit symbol txd015 txd014 txd013 txd012 txd011 txd010 txd009 txd008 read/write r/w reset state 0 0 0 0 0 0 0 0 (0c11h) function transmit data bits [15:8] figure 3.11.17 hsc0td register (a) this register is used for writing the transmit data. when this register is read, the last-written data is read out. this register is overwritten if the next data is written with this register being full. please check the state of the rfw0 bit before starting a write operation. hsc0ct = ?1?, all bits are valid. hsc0ct = ?0?, lower 7 bits are valid.
tmp92cy23/cd23a 2009-08-28 92cy23-267 (6) receive data register this register is used for reading the received data. hsc0rd register 7 6 5 4 3 2 1 0 bit symbol rxd007 rxd006 rxd005 rxd004 rxd003 rxd002 rxd001 rxd000 read/write r reset state 0 0 0 0 0 0 0 0 function receive data register [7:0] hsc0rd (0c12h) 15 14 13 12 11 10 9 8 bit symbol rxd015 rxd014 rxd013 rxd012 rxd011 rxd010 rxd009 rxd008 read/write r reset state 0 0 0 0 0 0 0 0 (0c13h) function receive data register [15:8] figure 3.11.18 hsc0rd register (a) the hsc0rd register is used for reading the received data. please check the state of the rfr0 bit before starting a read operation. hsc0ct = ?1?, all bits are valid. hsc0ct = ?0?, lower 7 bits are valid.
tmp92cy23/cd23a 2009-08-28 92cy23-268 (7) transmit data shift register this register is used for changi ng the transmission data to seri al. this register is used for confirming the changing condition when lsi test. hsc0ts register 7 6 5 4 3 2 1 0 bit symbol tsd007 tsd006 tsd005 tsd004 tsd003 tsd002 tsd001 tsd000 read/write r reset state 0 0 0 0 0 0 0 0 function transmit data shift register [7:0] hsc0ts (0c14h) 15 14 13 12 11 10 9 8 bit symbol tsd015 tsd014 tsd013 tsd012 tsd011 tsd010 tsd009 tsd008 read/write r reset state 0 0 0 0 0 0 0 0 (0c15h) function transmit data shift register [15:8] figure 3.11.19 hsc0ts register (a) this register is used for reading the stat us of transmission data shift register. hsc0ct = ?1?, all bits are valid. hsc0ct = ?0?, lower 7 bits are valid.
tmp92cy23/cd23a 2009-08-28 92cy23-269 (8) receive data shift register this register is used for readin g the receive data shift register. hsc0rs register 7 6 5 4 3 2 1 0 bit symbol rsd007 rsd006 rsd005 rsd004 rsd003 rsd002 rsd001 rsd000 read/write r reset state 0 0 0 0 0 0 0 0 function receive data shift register [7:0] hsc0rs (0c16h) 15 14 13 12 11 10 9 8 bit symbol rsd015 rsd014 rsd013 rsd012 rsd011 rsd010 rsd009 rsd008 read/write r reset state 0 0 0 0 0 0 0 0 (0c17h) function receive data shift register [15:8] figure 3.11.20 hsc0rs register (a) this register is used for reading the status of receive data shift register. hsc0ct = ?1?, all bits are valid. hsc0ct = ?0?, lower 7 bits are valid.
tmp92cy23/cd23a 2009-08-28 92cy23-270 3.11.3 operation timing following examples show operation timing. ? setting condition 1: transmission in unit = 8bit, lsb first figure 3.11.21 transmission timing in above condition, hsc0st flag is set to ?0? just after wrote transmission data. when data of hsc0td register finish shif ting to transmission register (hsc0ts), hsc0st is set to ?1?, it is informed that can write next transmission data, start transmission clock and data from hsclk pin an d hsso pin at same time with inform. in this case, hsc0is, hsc0ir change and inthsc interrupt generate by synchronization to rising of hsc0st flag . when hsc0ir register is setting to ?1?, interrupt is not generated even if hsc0st was set to ?1?. when finish transmission and lose data that must to transmit to hsc0td register and hsc0ts register, transmission data an d clock are stopped by setting ?1? to hsc0st, and inthsc interrupt is generated at same time. in this case, if hsc0st is set to ?1? at different in terrupt source, inthsc is not generated. therefore must to clear hsc0is to ?0?. hsclk pin ( = ?0? ) hsso pin hsclk pin (= ?1?) msb msb hsc0is hsc0is hsc0st hsc0st inthsc interrupt signal hsc0td write p ulse hsc0ir (hsc0ie= ?1?) hsc0is clear write p ulse hsc0ir (hsc0ie= ?1?) lsb lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92cy23/cd23a 2009-08-28 92cy23-271 ? setting condition 2: unit transmission in unit=8bit, lsb first figure 3.11.22 unit receiving (hsc0ct=1) if set hsc0ct to ?1? without va lid receiving data to hsc0rd register (hsc0st = 0), unit receiving is started. when receiving is finished and stored receiving data to hsc0rd regist er, hsc0st flag is set to ?1?, and inform that can read receiving data. just after read hsc0rd register, hsc0st flag is cleared to ?0? and it start receiving next data automatically. if be finished unit receiving, set hsc0 ct to ?0? after confirmed that hsc0st was set to ?1?. hsc0rd read p ulse hsclk pin ( =?0? ) hssi pin hsclk pin (=?1?) lsb msb msb hsc0is hsc0is hsc0st hsc0st lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92cy23/cd23a 2009-08-28 92cy23-272 ? setting condition 3: sequential receiving in unit=8 bit, lsb first figure 3.11.23 continuous rece iving (hsc0ct=1) if set hsc0ct to ?1? without va lid receiving data in hsc0rd register (hsc0st = 0), sequential receiving is started. when first receiving is finished and stored receiving data to hsc0rd register, hsc0st flag is set to ?1?, and inform that can read receiving data. sequential receivin g is received until receiving data is stored to hsc0rd and hsc0rs registers if finished sequential receiving, set hsc0ct to ?0? after confirmed that hsc0st was set to ?1?. hsc0rd read p ulse hsclk pin ( =?0? ) hssi pin hsclk pin (=?1?) hsc0is hsc0st hsc0st hsc0is lsb msb lsb msb lsb msb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92cy23/cd23a 2009-08-28 92cy23-273 ? setting condition 4: transmission by using micro dma in unit=8bit, lsb first figure 3.11.24 micro dma transmission (transmission) if all bits of hsc0ie register are ?0? and hsc0ct is ?1?, transmission is started by writing transmission data to hsc0td register. if data of hsc0td register is shifted to hsc0ts register and hsc0st is set to ?1? and can write next transmission data, inthsc interrupt (rfw0 interrupt) is generated. by starting micro dma at this interrupt, can transmit sequential data automatically. however, if transmit it at micr o dma, set micro dma beforehand. hsc0td write p ulse hsclk pin ( =?0? ) hsso pin hsclk pin (=?1?) hsc0is hsc0is hsc0st hsc0st inthsc interrupt p ulse hsc0ir lsb msb lsb msb lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7 bit0
tmp92cy23/cd23a 2009-08-28 92cy23-274 ? setting condition 5: receiving by using micro dma in unit = 8bit, lsb first figure 3.11.25 micro dma transmission (unit receiving (hsc0ct=1)) if all bits of hsc0ie register is ?0? and hsc0ct is ?1?, unit receiving is started by setting hsc0ct to ?1?. if receiving data is stored to hsc0rd register and can read receiving data, inthsc interrupt (rfr0 interrupt) is generated. by starting micro dma at this interrupt, it can be received sequential data automatically. however, if receive it at micro dma, set micro dma beforehand. hsc0rd read p ulse hsc0is hsc0is hsc0st hsc0st inthsc interrupt pulse hsclk pin ( = ?0? ) hssi pin hsclk pin (= ?1?) lsb msb lsb msb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92cy23/cd23a 2009-08-28 92cy23-275 3.11.4 example following is discription of hsc setting method. (1) unit transmission this example shows the case of transmission is executed by following setting, and it is generated inthsc interrupt by finish transmission. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting expample ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (hsc0ie), 0x08 ; set to tend0 interrupt enable ld (intes1hsc), 0x10 ; set inthsc interrupt level to 1 ei ; interrupt enable (iff = 0) loop ; co nfirm that transmission data register doesn?t have no transmission data bit 1, (hsc0st) ; =1 ? jr z, loop ld (hsc0td), 0x3a ; writ e transmission data and start transmission ? ? ? figure 3.11.26 example of unit transmission hsclk output hsso output hsc0td write pulse inthsc interrupt signal (internal clock)
tmp92cy23/cd23a 2009-08-28 92cy23-276 (2) unit receiving this example shows case of receiving is executed by following setting, and it is generated inthsc interrupt by finish receiving. unit: 8bit lsb first baud rate selection : f sys /8 synchronous clock edge: rising setting example ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronou s clock edge setting: set to rising ld (hsc0ie), 0x01 ; set to rfr0 interrupt enable ld (intes1hsc), 0x10 ; set inthsc interrupt level to 1 ei ; interrupt enable (iff = 0) set 0x0, (hsc0ct) ; start unit receiving ? ? ? figure 3.11.27 example of unit receiving hsclk output hssi input hsc0ct write pulse inthsc interrupt signal hsc0rd data xx 0x3a
tmp92cy23/cd23a 2009-08-28 92cy23-277 (3) sequential transmission this example shows case of transmission is executed by following setting, and it is executed 2byte sequential transmission. unit: 8bit lsb first baud rate selection: f sys /8 synchronous clock edge: rising setting example ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronou s clock edge setting: set to rising loop1: ; confirm that transmission data register doesn?t have no transmission data bit 1, (hsc0st) ; =1 ? jr z, loop1 ld (hsc0td), 0x3a ; write tran smission data of first byte and start transmission loop2 ; confirm that transmission data register doesn?t have no-transmission data bit 1, (hsc0st) ; =1 ? jr z, loop2 ld (hsc0td), 0x55 ; write transmission data of second byte loop3: ; conf irm that transmission data register doesn?t have no-transmission data bit 3, (hsc0st) ; = 1 ? jr z, loop3 ? ; finish transmission ? note: timing of this figure is an example. there is also that transmission inte rbal between first byte and sescond byte generate. (high baud rate etc.) figure 3.11.28 example of sequential transmission hsclk output hsso output hsc0td write pulse inthsc (rfw0) interrupt signal
tmp92cy23/cd23a 2009-08-28 92cy23-278 (4) sequential receiving this example shows case of receiving is executed by following setting, and it is executed 2byte sequential receiving. unit: 8bit lsb first baud rate selection: f sys /8 synchronous clock edge: rising setting example ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; po rt setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronou s clock edge setting: set to rising set 0x01,(hsc0ct) ; start sequential receiving loop1: ; conf irm that receiving data register has receiving data of first byte bit 0, (hsc0st) ; =1 ? jr z, loop1 loop2: ; conf irm that receiving data register ha s receiving data of second byte bit 2, (hsc0st) ; = 1 ? jr z, loop2 res 0x01, (hsc0ct) ; sequential receiving disable ld a, (hsc0rd) ; read receiving data of first byte loop3: ; confirm that receiving data of second byte is shifted from receiving data shift register to receiving data register bit 0, (hsc0st) ; =1 ? jr z, loop3 ld w, (hsc0rd) ; read receiving data of second byte figure 3.11.29 example of sequential receiving hsclk output hssi input hsc0rd read pulse hsc0rs data xx 0x3a hsc0rd data xx 0x55 0x55
tmp92cy23/cd23a 2009-08-28 92cy23-279 (5) sequeintial transmission by using micro dma this example shows case of sequential transmission of 4byte is executed at using micro dma by following setting. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting example main routine ;-- micro dma setting -- ld (dma0v), 0x1d ; set micro dma0 to inthsc ld wa, 0x0003 ; set number of mi cro dma transmission to th at number -1 (third time) ldc dmac0, wa ld a, 0x08 ; micro dma mode setting: source in c mode, 1 byte transfer ldc dmam0, a ld xwa, 0x806000 ; set source address ldc dmas0, xwa ld xwa, 0xc10 ; set source address to hsc0td register ldc dmad0, xwa ;-- hsc setting -- ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; po rt setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronou s clock edge setting: set to rising ld (hsc0ie), 0x00 ; set to interrupt disable set 1, (hsc0ct+ 1) ; set micro dma operation by rfw0 to enable ld (intetc01), 0x01 ; set inttc0 interrupt level to 1 ei ; interrupt enable (iff = 0) loop1: ; confir m that transmission data register doesn?t have no transmission data bit 1, (hsc0st) ; =1 ? jr z, loop1 ld (hsc0td), 0x3a ; writ e transmission data and start transmission interrupt routine (inttc0) loop2: bit 1, (hsc0st) ; = 1 ? jr z, loop2 bit 3, (hsc0st) ; = 1 ? jr z, loop2 nop
tmp92cy23/cd23a 2009-08-28 92cy23-280 (6) unit receiving by using micro dma this example shows case of unit receiving sequentially 4byte is executed at using micro dma by following setting. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting example main routine ;-- micro dma setting -- ld (dma0v), 0x1d ; set micro dma0 to inthsc ld wa, 0x0003 ; set number of mi cro dma transmission to that number -1 (third time) ldc dmac0, wa ld a, 0x00 ; micro dm a mode setting: source inc mode, 1 byte transfer ldc dmam0, a ld xwa, 0xc12 ; set source address to hsc0rd register ldc dmas0, xwa ld xwa, 0x807000 ; set source address ldc dmad0, xwa ;-- hsc setting -- ld (pffc), 0x38 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (pfcr), 0x28 ; port setting pf3: hsso, pf4: hssi, pf5: hsclk ld (hscsel), 0x01 ; po rt setting pf3: hsso, pf4: hssi, pf5: hsclk ldw (hsc0ct), 0x0040 ; set data length to 8bit ldw (hsc0md), 0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (hsc0ie), 0x00 ; set to interrupt disable set 0, (hsc0ct+ 1) ; set micro dma operation by rfr0 to enable ld (intetc01), 0x01 ; set inttc0 interrupt level to 1 ei ; interrupt enable (iff = 0) set 0x0, (hsc0ct) ; start unit receiving interrupt routine (inttc0) loop2: ; wait receiving fi nish case of unit receiving bit 0, (hsc0st) ; = 1 ? jr z, loop2 res 0, (hsc0ct) ; unit receiving disable ld a, (hsc0rd) ; read last receiving data nop
tmp92cy23/cd23a 2009-08-28 92cy23-281 3.12 analog/digital converter the tmp92cy23/cd23a incorporates a 10-bit su ccessive approximation type analog/digital converter (ad converter) with 12-channel analog input. figure 3.12.1 is a block diagram of the ad conv erter . the 12-channel analog input pins (an0 to an11) are shared with the input only port (port g and port l) so they can be used as an input port. note: when idle2, idle1 or stop mode is selected, in order to reduce the power consumption, the system may enter a stand-by mode with some timings even though the internal comparator is still enabled. therefore be sure to check that ad converter operations ar e halted before a halt instruction is executed. figure 3.12.1 block diagr am of ad converter internal data bus ad mode control register 0 admod0 ad mode control registers 1 and 2 admod, 2 ad converter control circuit scan re p eat interru p t busy end start adtrg ad conversion result register adreg0l to adregbl a dreg0h to adregbh da converter sample and hold multiplexer decoder com p arato r avcc(avcc) avss(vrefl) intad interrupt channel select analog input an11/ adtrg (pl3) an10 (pl2) an9 (pl1) an8 (pl0) an7 (pg7) an6 (pg6) an5 (pg5) an4 (pg4) an3 (pg3) an2 (pg2) an1 (pg1) an0 (pg0)
tmp92cy23/cd23a 2009-08-28 92cy23-282 3.12.1 analog/digital converter registers the ad converter is controlled by the three ad mode control registers: admod0, admod1 and admod2. the 24 ad conversion data result registers (adreg0h/l to adregbh/l) store the results of ad conversion. figure 3.12.2 to figure 3.12.10 show the registers related to the ad converter. ad mode control register 0 7 6 5 4 3 2 1 0 bit symbol eocf adbf ? ? itm0 repeat scan ads admod0 (12b8h) read/write r r/w reset state 0 0 0 0 0 0 0 0 function ad conversion end flag 0:conversion in progress 1:conversion complete ad conversion busy flag 0:conversion stopped 1:conversion in progress always write ?0? always write ?0? interrupt specification in conversion channel fixed repeat mode 0:every conversion 1:every fourth conversion repeat mode specification 0:single conversion 1:repeat conversion mode scan mode specification 0:conversion channel fixed mode 1:conversion channel scan mode ad conversion start 0: don?t care 1:start conversion always ?0? when read ad conversion start 0 don?t care 1 start ad conversion note: always read as ?0?. ad scan mode setting 0 ad conversion channel fixed mode 1 ad conversion channel scan mode ad repeat mode setting 0 ad single conversion mode 1 ad repeat conversion mode specify ad conversion interrupt for channel fixed repeat conversion mode channel fixed repeat conversion mode = ?0?, = ?1? 0 generates interrupt every conversion. 1 generates interrupt every fourth conversion. ad conversion busy flag 0 ad conversion stopped 1 ad conversion in progress ad conversion end flag 0 before or during ad conversion 1 ad conversion complete figure 3.12.2 register for ad converter
tmp92cy23/cd23a 2009-08-28 92cy23-283 ad mode control register 1 7 6 5 4 3 2 1 0 bit symbol vrefon i2ad ? ? adch3 adch2 adch1 adch0 admod1 (12b9h) read/write r/w reset state 0 0 0 0 0 0 0 0 function vref application control 0: off 1: on idle2 0: stop 1: operate always write ?0? always write ?0? analog input channel selection analog input channel selection idle2 control 0 stopped 1 in operation control of application of reference voltage to ad converter 0 off 1 on note: as pin an11 also functions as the adtrg input pin, do not set admod1 = ? 1011? when using adtrg with admod2 set to ?1?. figure 3.12.3 register for ad converter 0 channel fixed 1 channel scanned 0000 an0 an0 0001 an1 an0 an1 0010 an2 an0 an1 an2 0011 an3 an0 an1 an2 an3 0100 an4 an0 an1 an2 an3 an4 0101 an5 an0 an1 an2 an3 an4 an5 0110 an6 an0 an1 an2 an3 an4 an5 an6 0111 an7 an0 an1 an2 an3 an4 an5 an6 an7 1000 an8 an0 an1 an2 an3 an4 an5 an6 an7 an8 1001 an9 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 1010 an10 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 1011 an11 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11 1100 ~ 1111 please do not set up.
tmp92cy23/cd23a 2009-08-28 92cy23-284 ad mode control register 2 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? ? adtrge admod2 (12bah) read/write r/w reset state 0 0 0 0 0 0 0 0 function always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? ad external trigger start control 0: disable 1: enable ad conversion start control by external trigger ( adtrg input) 0 disabled 1 enabled figure 3.12.4 register for ad converter
tmp92cy23/cd23a 2009-08-28 92cy23-285 ad conversion result register 0 low 7 6 5 4 3 2 1 0 bit symbol adr01 adr00 adr0rf adreg0l (12a0h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1:conversion result stored ad conversion result register 0 high 7 6 5 4 3 2 1 0 bit symbol adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 adreg0h (12a1h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register 1 low 7 6 5 4 3 2 1 0 bit symbol adr11 adr10 adr1rf adreg1l (12a2h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1:conversion result stored ad conversion result register 1 high 7 6 5 4 3 2 1 0 bit symbol adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 adreg1h (12a3h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.5 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-286 ad conversion result register 2 low 7 6 5 4 3 2 1 0 bit symbol adr21 adr20 adr2rf adreg2l (12a4h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1:conversion result stored ad conversion result register 2 high 7 6 5 4 3 2 1 0 bit symbol adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 adreg2h (12a5h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register 3 low 7 6 5 4 3 2 1 0 bit symbol adr31 adr30 adr3rf adreg3l (12a6h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register 3 high 7 6 5 4 3 2 1 0 bit symbol adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 adreg3h (12a7h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.6 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-287 ad conversion result register 4 low 7 6 5 4 3 2 1 0 bit symbol adr41 adr40 adr4rf adreg4l (12a8h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1:conversion result stored ad conversion result register 4 high 7 6 5 4 3 2 1 0 bit symbol adr49 adr48 adr47 adr46 adr45 adr44 adr43 adr42 adreg4h (12a9h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register 5 low 7 6 5 4 3 2 1 0 bit symbol adr51 adr50 adr5rf adreg5l (12aah) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1:conversion result stored ad conversion result register 5 high 7 6 5 4 3 2 1 0 bit symbol adr59 adr58 adr57 adr56 adr55 adr54 adr53 adr52 adreg5h (12abh) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.7 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-288 ad conversion result register 6 low 7 6 5 4 3 2 1 0 bit symbol adr61 adr60 adr6rf adreg6l (12ach) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register 6 high 7 6 5 4 3 2 1 0 bit symbol adr69 adr68 adr67 adr66 adr65 adr64 adr63 adr62 adreg6h (12adh) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register 7 low 7 6 5 4 3 2 1 0 bit symbol adr71 adr70 adr7rf adreg7l (12aeh) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register 7 high 7 6 5 4 3 2 1 0 bit symbol adr79 adr78 adr77 adr76 adr75 adr74 adr73 adr72 adreg7h (12afh) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.8 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-289 ad conversion result register 8 low 7 6 5 4 3 2 1 0 bit symbol adr81 adr80 adr8rf adreg8l (12b0h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register 8 high 7 6 5 4 3 2 1 0 bit symbol adr89 adr88 adr87 adr86 adr85 adr84 adr83 adr82 adreg8h (12b1h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register 9 low 7 6 5 4 3 2 1 0 bit symbol adr91 adr90 adr9rf adreg9l (12b2h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register 9 high 7 6 5 4 3 2 1 0 bit symbol adr99 adr98 adr97 adr96 adr95 adr94 adr93 adr92 adreg9h (12b3h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.9 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-290 ad conversion result register a low 7 6 5 4 3 2 1 0 bit symbol adra1 adra0 adrarf adregal (12b4h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register a high 7 6 5 4 3 2 1 0 bit symbol adra9 adra8 adra7 adra6 adra5 adra4 adra3 adra2 adregah (12b5h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. ad conversion result register b low 7 6 5 4 3 2 1 0 bit symbol adrb1 adrb0 adrbrf adregbl (12b6h) read/write r r reset state undefined 0 function stores lower 2 bits of ad conversion result. a d conversion data storage flag 1: conversion result stored ad conversion result register b high 7 6 5 4 3 2 1 0 bit symbol adrb9 adrb8 adrb7 adrb6 adrb5 adrb4 adrb3 adrb2 adregbh (12b7h) read/write r reset state undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as ?1?. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to ?1?. when either of the registers (adregxh, adregxl) is read, the flag is cleared to ?0?. figure 3.12.10 register for ad converter a dregxh adregxl channel x conversion result
tmp92cy23/cd23a 2009-08-28 92cy23-291 3.12.2 description of operation (1) analog reference voltage a high level analog reference voltage is a pplied to the avcc pin; a low level analog reference voltage is applied to the avss pin. to perform ad conversion, the reference voltage, the difference between avcc and avss, is divided by 1024 using string resistance. the result of the division is then compared with the analog input voltage. to turn off the switch between avcc and avss, write ?0? to admod1 in ad mode control register 1. to start ad conversion in the off state, first write ?1? to admod1, wait 3 s until the internal reference voltage stabilizes (this is not related to fc), then set admod0 to ?1?. (2) analog input channel selection the analog input channel selection varies depending on the operation mode of the ad converter. ? in analog input channel fixed mode (admod0 = ?0?) setting admod1 selects one of the input pins an0 to an3 as the input channel. ? in analog input channel scan mode (admod0 = ?1?) setting admod1 selects one of the four scan modes. table 3.12.1 illustrates analog input channel selection in each operation mode. on a reset, admod 0 is set to 0 and admod1 is initialized to ?00?. thus pin an0 is selected as the fixed in put channel. pins not used as analog input channels can be used as standard input port pins. table 3.12.1 analog input channel selection channel fixed = ?0? channel scan = ?1? 0000 an0 an0 0001 an1 an0 an1 0010 an2 an0 an1 an2 0011 an3 an0 an1 an2 an3 0100 an4 an0 an1 an2 an3 an4 0101 an5 an0 an1 an2 an3 an4 an5 0110 an6 an0 an1 an2 an3 an4 an5 an6 0111 an7 an0 an1 an2 an3 an4 an5 an6 an7 1000 an8 an0 an1 an2 an3 an4 an5 an6 an7 an8 1001 an9 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 1010 an10 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 1011 an11 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11
tmp92cy23/cd23a 2009-08-28 92cy23-292 (3) starting ad conversion to start ad conversion, write ?1? to admod0 in ad mode control register ?0? or admod2 in ad mode control register 2, and input falling edge on adtrg pin. when ad conversion starts, the ad conversion busy flag admod0 will be set to ?1?, indicating that ad conversion is in progress. during ad conversion, a falling edge input on the adtrg pin will be ignored. (4) ad conversion modes and the ad conversion end interrupt the four ad conversion modes are: ? channel fixed single conversion mode ? channel scan single conversion mode ? channel fixed repeat conversion mode ? channel scan repeat conversion mode the admod0 and admod0 settings in ad mode control register 0 determine the ad mode setting. completion of ad conversion triggers an intad ad conversion end interrupt request. also, admod0 will be set to ?1? to indicate that ad conversion has been completed. 1. channel fixed single conversion mode setting admod0 and admod0 to ?00? selects conversion channel fixed single conversion mode. in this mode, data on one specified channel is converted once only. when the conversion has been completed, the admod0 flag is set to ?1?, admod0 is cleared to ?0?, and an intad interrupt request is generated. 2. channel scan single conversion mode setting admod0 and admod0 to ?01? selects conversion channel scan single conversion mode. in this mode, data on the specified scan channels is converted once only. when scan conversion has been complete d, admod0 is set to ?1?, admod0 is cleared to ?0?, and an intad interrupt request is generated.
tmp92cy23/cd23a 2009-08-28 92cy23-293 3. channel fixed repeat conversion mode setting admod0 and admod0 to ?10? selects conversion channel fixed repeat conversion mode. in this mode, data on one specified channel is converted repeatedly. when conversion has been completed, admod0 is set to ?1? and admod0 is not cleared to ?0? but held at ?1?. intad interrupt request generation timing is determined by the setting of admod0. clearing to ?0? generates an interrupt request every time an ad conversion is completed. setting to ?1? generates an inte rrupt request on completion of every fourth conversion. 4. channel scan repeat conversion mode setting admod0 and admod0 to ?11? selects conversion channel scan repeat conversion mode. in this mode, data on the specified scan channels is converted repeatedly. when each scan conversion has been completed, admod0 is set to ?1? and an intad interrupt request is generated. admod0 is not cleared to ?0? but held at ?1?. to stop conversion in a repe at conversion mode (e.g., in cases 3. and 4.), write ?0? to admod0. after the current conversion has been completed, the repeat conversion mode terminates an d admod0 is cleared to ?0?. switching to a halt state (idle2 mode with admod1 cleared to ?0?, idle1 mode or stop mode) immediately stops operation of the ad converter even when ad conversion is still in progress. in repeat conversion modes (e.g., in cases 3. and 4.), when the halt is released, conversion restarts from the beginning. in single conversion modes (e.g., in cases 1. and 2.), conversion does not restart when the halt is released (the converter remains stopped). table 3.12.2 shows the relationship between the ad conversion modes and interrupt r e quests. table 3.12.2 relationship between ad conversion modes and interrupt requests admod0 mode interrupt request generation channel fixed single conversion mode after completion of conversion x 0 0 channel scan single conversion mode after completion of scan conversion x 0 1 every conversion 0 channel fixed repeat conversion mode every fourth conversion 1 1 0 channel scan repeat conversion mode after completion of every scan conversion x 1 1 x: don?t care
tmp92cy23/cd23a 2009-08-28 92cy23-294 (5) ad conversion time 84 states (4.2 s at f sys = 20 mhz) are required for the ad conversion of one channel. (6) storing and reading the results of ad conversion the ad conversion data upper and lowe r registers (adreg0h/l to adregbh/l) store the results of ad conversion. (adreg0h/l to adregbh/l are read-only registers.) in channel fixed repeat conversion mo de, the conversion results are stored successively in registers fr om adreg0h/l to adregbh/l. in other modes from an0 to an11 conversion results are stored in from adreg0h/l to adregbh/l respectively. table 3.12.3 shows the correspondence between the analog input channels and the registers wh i ch are used to hold the results of ad conversion. table 3.12.3 correspondence between analog inpu t channels and ad conversion result registers ad conversion result register analog input channel (port g/port l) conversion modes othe r than at right channel fixed repeat conversion mode (admod0 = ?1?) an0 adreg0h/l an1 adreg1h/l an2 adreg2h/l an3 adreg3h/l adreg0h/l an4 adreg4h/l an5 adreg5h/l adreg1h/l an6 adreg6h/l an7 adreg7h/l adreg2h/l an8 adreg8h/l an9 adreg9h/l adreg3h/l an10 adregah/l an11 adregbh/l the ad conversion data storage flag indicates whether the ad conversion result register has been read or not. when a conversion result is stored in the ad conversion result register, the flag is set to ?1?. when either of the ad conversion result registers (adregxh or adregxl) is read, the flag is cleared to ?0?. reading the ad conversion result also clears the ad conversion end flag admod0 to ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-295 setting example: 1. convert the analog input voltage on the an3 pin and write the result to memory address 2800h using the ad interrupt (intad) processing routine. main routine: 7 6 5 4 3 2 1 0 intepad x ? ? ? x 1 0 0 enable intad and set it to interrupt level 4. admod1 1 1 0 0 0 0 1 1 set pin an3 to be the analog input channel. admod0 x x 0 0 0 0 0 1 start conversion in channel fixed single conversion mode. interrupt routine processing example: wa adreg3h/l read value of adreg3l and adreg3h into 16-bits general-purpose register wa. wa > > 6 shift contents read into wa six times to right and ?0? fill upper bits. (2800h) wa write contents of wa to memory address 2800h. 2. this example repeatedly converts the analog input voltages on the three pins an0, an1 and an2, using channel scan repeat conversion mode. intepad x ? ? ? x 0 0 0 disable intad. admod1 1 1 0 0 0 0 1 0 set pins an0 to an2 to be the analog input channels. admod0 x x 0 0 0 1 1 1 start conversion in channel scan repeat conversion mode. x : don't care, ?: no change
tmp92cy23/cd23a 2009-08-28 92cy23-296 3.13 watchdog timer (runaway detection timer) the tmp92cy23/cd23a contains a watchdog timer of runaway detecting. the watchdog timer (wdt) is used to return the cpu to the normal state when it detects that the cpu has started to malfunction (runaway) due to causes such as noise. when the watchdog timer detects a malfunction, it generates a non-maskable interrupt intwd to notify the cpu of the malfunction. connecting the watchdog timer output to th e reset pin internally forces a reset. (the level of external reset pin is not changed.) 3.13.1 configuration figure 3.13.1 is a block diagram of the watchdog timer (wdt). figure 3.13.1 block diagram of watchdog timer note: care must be exercised in the overall design of the apparatus since the watchdog timer may fail to function correctly due to external noise, etc. wdmod reset pin selector 2 15 2 17 2 19 2 21 binary counter (22 stages) q r s wdt control register wdcr write b1h write 4eh reset control wdmod internal reset intwd interrupt internal reset f sys wdmod internal data bus reset
tmp92cy23/cd23a 2009-08-28 92cy23-297 3.13.2 operation the watchdog timer generates an intwd interrupt when the detection time set in the wdmod has elapsed. the watchdog timer must be cleared ?0? in software before an intwd interrupt will be generated. if the cpu malfunctions (e.g., if runaway occurs) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter will overflow and an intwd interrupt will be generated. the cpu will detect malfunction (runaway) due to the intwd interrupt and in this case it is possible to return to the cpu to normal operation by means of an anti-malfunction program. the watchdog timer begins operating immediately on release of the watchdog timer reset. the watchdog timer is halted in idle1 or stop mode. when the device is in idle2 mode, the operation of wdt depends on the wdmod setting. ensure that wdmod is set before the device enters idle2 mode. the watchdog timer consists of a 22-stage binary counter which uses the clock f sys as the input clock. the binary counter can output 2 15 /f sys , 2 17 /f sys , 2 19 /f sys and 2 21 /f sys . figure 3.13.2 normal mode the runaway detection result can also be connected to the reset pin internally. in this case, the reset time will be betw een 22 and 29 system clocks (70.4 to 92.8 s at f osch = 10 mhz) as shown in figure 3.13.3. after a reset, the f sys clock is f fph /2, where f fph is generated by dividing the high-speed oscillator clock (f osch ) by sixteen through the clock gear function figure 3.13.3 reset mode overflow n 0 wdt counte r wdt interru p t wdt clea r (software) write clear code n wdt counte r wdt interru p t 22 to 29 clocks (70.4 to 92.8 s at f osch = 10 mhz) overflow internal reset
tmp92cy23/cd23a 2009-08-28 92cy23-298 3.13.3 control registers the watchdog timer (wdt) is controlled by two control registers wdmod and wdcr. (1) watchdog timer mode register (wdmod) 1. setting the detection time for the watchdog timer in this 2-bit register is used for setting the watchdog timer interrupt time used when detecting runaway. on a reset this register is initialized to wdmod = ?00?. the detection time for wdt is 2 15 /f sys [s]. 2. watchdog timer enable/disable control register at reset, the wdmod is initia lized to ?1?, enabling the watchdog timer. to disable the watchdog timer, it is necessary to set this bit to ?0? and to write the disable code (b1h) to the watchdog timer control register (wdcr). this makes it difficult for the watchdog timer to be disabled by runaway. however, it is possible to return the watchdog timer from the disabled state to the enabled state merely by setting to ?1?. 3. watchdog timer out reset connection this register is used to connect the output of the watchdog timer with the reset terminal internally. since wdmod is initialized to ?0? at reset, a reset by the watchdog time r will not be performed. (2) watchdog timer control register (wdcr) this register is used to disable and clear the binary counter for the watchdog timer. ? disable control the watchdog timer can be disabled by clearing wdmod to ?0? and then writing the disable code (b1h) to the wdcr register. wdcr 0 1 0 0 1 1 1 0 write the clear code (4eh). wdmod 0 ? ? x0 ? ? 0 clear wdmod to ?0?. wdcr 1 0 1 1 0 0 0 1 write the disable code (b1h). ? enable control set wdmod to ?1?. ? watchdog timer clear control to clear the binary counter and cause counting to resume, write the clear code (4eh) to the wdcr register. wdcr 0 1 0 0 1 1 1 0 write the clear code (4eh). note1: if the disable control is used, set the disable c ode (b1h) to wdcr after writing the clear code (4eh) once. (please refer to setting example.) note2: if the watchdog timer setting is changed, change setting after setting to di sable condition once.
tmp92cy23/cd23a 2009-08-28 92cy23-299 7 6 5 4 3 2 1 0 bit symbol wdte wdtp1 wdtp0 ? i2wdt rescr ? wdmod (1300h) read/write r/w r/w reset state 1 0 0 0 0 0 0 function wdt control 1: enable select detecting time 00: 2 15 /f sys 01: 2 17 /f sys 10: 2 19 /f sys 11: 2 21 /f sys always write ?0? idle2 0: stop 1: operate 1: internally connects wdt out to the reset pin always write ?0? watchdog timer out control 0 ? 1 connects wdt out to a reset idle2 control 0 stop 1 operation watchdog timer detection time 00 2 15 /f sys (approximately 1.64 ms at f sys = 20 mhz) 01 2 17 /f sys (approximately 6.55 ms at f sys = 20 mhz) 10 2 19 /f sys (approximately 26.2 ms at f sys = 20 mhz) 11 2 21 /f sys (approximately 104.9 ms at f sys = 20 mhz) watchdog timer enable/disable control 0 disabled 1 enabled figure 3.13.4 watchdog timer mode register 7 6 5 4 3 2 1 0 bit symbol ? wdcr (1301h) read/write w reset state ? function b1h: wdt disable code 4eh: wdt clear code wdt disable/clear control b1h disable code 4eh clear code others don?t care figure 3.13.5 watchdog timer control register a read-modify- write operation cannot be performed
tmp92cy23/cd23a 2009-08-28 92cy23-300 3.14 special timer for clock the tmp92cy23/cd23a includes a timer wh ich is used for a clock operation. an interrupt (intrtc) can be generated each 0. 0625[s] or 0.125[s] or 0.25[s] or 0.50[s] by using a low-frequency clock of 32.768 khz. a clock function can be easily used. special timer for clock can operate in all modes in which a low-frequency oscillation is operated. in addition, intrtc can return from each standby mode except stop mode. figure 3.14.1 block diagram for special timer for clock the special timer for clock is controlled by special timer for clock control register (rtccr). figure 3.14.2 shows the timer for re al time clock c ontrol regist er . 7 6 5 4 3 2 1 0 bit symbol ? rtcsel1 rtcsel0 rtcrun read/write r/w r/w reset state 0 0 0 0 rtccr (1310h) function always write ?0? 00 : 2 14 /fs 01 : 2 13 /fs 10 : 2 12 /fs 11 : 2 11 /fs 0: stop & clear 1: run 0 stop & clear 1 count 00 0.50s 11 0.25s 10 0.125s 11 0.0625s figure 3.14.2 register for special timer for clock 14-stage binary counters selector interrupt request intrtc rtccr rtccr 2 14 run /clear 2 13 2 12 2 11 fs (32.768 khz) interrupt generation cycle (fs = 32.768 khz) counting operation
tmp92cy23/cd23a 2009-08-28 92cy23-301 3.15 program patch logic the tmp92cy23/cd23a has a program patch logic, which enables the user to fix the program code in the internal rom. patch prog ram must be read into internal ram from external memory during the startup routine. up to eight 4-byte sequences or banks (32-byte s in total) can be replaced with patch code. more significant code correctio n can be performed by replacin g program code with 1-byte instruction code which generates a software interrupt (swi) to make a branch to a specified location in the internal ram area. the program patch logic only compares addresses in the internal rom area; it cannot fix the program code in the internal peripheral, internal ram and external rom areas. each of eight banks is independently programmable, and functionally equivalent. in the following sections, any references to bank0 also apply to other banks. 3.15.1 block diagram figure 3.15.1 program patch logic diagram note: don't set the same value to an address compare register (bank0 to 7). address bus romrd data bus romrd rom cpu address substitution regise r (bank0) (romsub0hh/hl/lh/ll) address substitution regise r (bank1) ( romsub1hh/hl/lh/ll ) add r ess substitution regise r (bank2) (romsub2hh/hl/lh/ll) address substitution regise r (bank3) (romsub3hh/hl/lh/ll) address substitution regise r (bank4) ( romsub4hh/hl/lh/ll ) address substitution regise r (bank5) ( romsub5hh/hl/lh/ll ) m a t c h signal output enable address compare registe r (bank2) (romcmp20 to romcmp22) address compare registe r (bank3) (romcmp30 to romcmp32) address compare registe r (bank4) (romcmp40 to romcmp42) address compare registe r (bank5) (romcmp50 to romcmp52) a ddress compare registe r (bank1) (romcmp10 to romcmp12) a ddress compare registe r (bank0) (romcmp00 to romcmp02) output control block address compare block address compare registe r (bank6) (romcmp60 to romcmp62) address compare registe r (bank7) (romcmp70 to romcmp72) add r ess substitution regise r (bank6) (romsub6hh/hl/lh/ll) address substitution regise r (bank7) ( romsub7hh/hl/lh/ll )
tmp92cy23/cd23a 2009-08-28 92cy23-302 3.15.2 sfr descriptions the program patch logic consists of eight banks (0 to 7). each bank is provided with 3-bytes of address compare re gisters (romcmp00 to romcmp72) and 4-bytes of address substitution registers (romsubll, romsublh, romsubhl and romsubhh). bank0 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp00 (1400h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank0 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp01 (1401h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank0 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp02 (1402h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp00, romcmp01 and romcmp02 registers. note 2: the 0 and 1 of romcmp00 are read as underfined values. figure 3.15.2 address co mpare registers (bank0)
tmp92cy23/cd23a 2009-08-28 92cy23-303 bank1 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp10 (1408h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank1 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp11 (1409h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank1 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp12 (140ah) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp10, romcmp11 and romcmp12 registers. note 2: the 0 and 1 of romcmp10 are read as underfined values. figure 3.15.3 address co mpare registers (bank1)
tmp92cy23/cd23a 2009-08-28 92cy23-304 bank2 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp20 (1410h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank2 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp21 (1411h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank2 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp22 (1412h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp20, romcmp21 and romcmp22 registers. note 2: the 0 and 1 of romcmp20 are read as underfined values. figure 3.15.4 address co mpare registers (bank2)
tmp92cy23/cd23a 2009-08-28 92cy23-305 bank3 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp30 (1418h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank3 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp31 (1419h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank3 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp32 (141ah) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp30, romcmp31 and romcmp32 registers. note 2: the 0 and 1 of romcmp30 are read as underfined values. figure 3.15.5 address co mpare registers (bank3)
tmp92cy23/cd23a 2009-08-28 92cy23-306 bank4 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp40 (1420h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank4 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp41 (1421h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank4 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp42 (1422h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp40, romcmp41 and romcmp42 registers. note 2: the 0 and 1 of romcmp40 are read as underfined values. figure 3.15.6 address co mpare registers (bank4)
tmp92cy23/cd23a 2009-08-28 92cy23-307 bank5 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp50 (1428h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank5 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp51 (1429h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank5 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp52 (142ah) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp50, romcmp51 and romcmp52 registers. note 2: the 0 and 1 of romcmp50 are read as underfined values. figure 3.15.7 address co mpare registers (bank5)
tmp92cy23/cd23a 2009-08-28 92cy23-308 bank6 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp60 (1430h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank6 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp61 (1431h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank6 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp62 (1432h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp60, romcmp61 and romcmp62 registers. note 2: the 0 and 1 of romcmp60 are read as underfined values. figure 3.15.8 address co mpare registers (bank6)
tmp92cy23/cd23a 2009-08-28 92cy23-309 bank7 address compare register 0 7 6 5 4 3 2 1 0 bit symbol romc07 romc06 romc05 romc04 romc03 romc02 romcmp70 (1438h) read/write w reset state 0 0 0 0 0 0 function target rom address (lower 6 bits) bank7 address compare register 1 7 6 5 4 3 2 1 0 bit symbol romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 romcmp71 (1439h) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (middle 8 bits) bank7 address compare register 2 7 6 5 4 3 2 1 0 bit symbol romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 romcmp72 (143ah) read/write w reset state 0 0 0 0 0 0 0 0 function target rom address (upper 8 bits) note 1: a read-modify-write operation cannot be perform ed in romcmp70, romcmp71 and romcmp72 registers. note 2: the 0 and 1 of romcmp70 are read as underfined values. figure 3.15.9 address co mpare registers (bank7)
tmp92cy23/cd23a 2009-08-28 92cy23-310 bank0 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub0ll (1404h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank0 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub0lh (1405h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank0 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub0hl (1406h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank0 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub0hh (1407h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub0ll, romsub0lh, romsub0hl and romsub0hh registers. figure 3.15.10 address subs titution registers (bank 0)
tmp92cy23/cd23a 2009-08-28 92cy23-311 bank1 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub1ll (140ch) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank1 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub1lh (140dh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank1 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub1hl (140eh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank1 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub1hh (140fh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub1ll, romsub1lh, romsub1hl and romsub1hh registers. figure 3.15.11 address subs titution registers (bank 1)
tmp92cy23/cd23a 2009-08-28 92cy23-312 bank2 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub2ll (1414h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank2 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub2lh (1415h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank2 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub2hl (1416h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank2 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub2hh (1417h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub2ll, romsub2lh, romsub2hl and romsub2hh registers. figure 3.15.12 address substitution registers (banks 2)
tmp92cy23/cd23a 2009-08-28 92cy23-313 bank3 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub3ll (141ch) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank3 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub3lh (141dh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank3 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub3hl (141eh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank3 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub3hh (141fh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub3ll, romsub3lh, romsub3hl and romsub3hh registers. figure 3.15.13 address substitution registers (banks 3)
tmp92cy23/cd23a 2009-08-28 92cy23-314 bank4 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub4ll (1424h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank4 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub4lh (1425h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank4 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub4hl (1426h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank4 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub4hh (1427h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub4ll, romsub4lh, romsub4hl and romsub4hh registers. figure 3.15.14 address substitution registers (banks 4)
tmp92cy23/cd23a 2009-08-28 92cy23-315 bank5 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub5ll (142ch) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank5 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub5lh (142dh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank5 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub5hl (142eh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank5 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub5hh (142fh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub5ll, romsub5lh, romsub5hl and romsub5hh registers. figure 3.15.15 address substitution registers (banks 5)
tmp92cy23/cd23a 2009-08-28 92cy23-316 bank6 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub6ll (1434h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank6 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub6lh (1435h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank6 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub6hl (1436h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank6 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub6hh (1437h) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub6ll, romsub6lh, romsub6hl and romsub6hh registers. figure 3.15.16 address substitution registers (banks 6)
tmp92cy23/cd23a 2009-08-28 92cy23-317 bank7 address substitution register ll 7 6 5 4 3 2 1 0 bit symbol roms07 roms06 roms05 roms04 roms03 roms02 roms01 roms00 romsub7ll (143ch) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank7 address substitution register lh 7 6 5 4 3 2 1 0 bit symbol roms15 roms14 roms13 roms12 roms11 roms10 roms09 roms08 romsub7lh (143dh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) bank7 address substitution register hl 7 6 5 4 3 2 1 0 bit symbol roms23 roms22 roms21 roms20 roms19 roms18 roms17 roms16 romsub7hl (143eh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (lower 8 bits) bank7 address substitution register hh 7 6 5 4 3 2 1 0 bit symbol roms31 roms30 roms29 roms28 roms27 roms26 roms25 roms24 romsub7hh (143fh) read/write w reset state 0 0 0 0 0 0 0 0 function patch code (upper 8 bits) note: a read-modify-write operation cannot be perfo rmed in romsub7ll, romsub7lh, romsub7hl and romsub7hh registers. figure 3.15.17 address substitution registers (banks 7)
tmp92cy23/cd23a 2009-08-28 92cy23-318 3.15.3 operation (1) replacing data correction procedure: load the address compare registers romcmpx0 to romcmpx2 (banks no. x = 0 to 7) with the target address where rom data need be replaced. store 4-byte patch code in the romsubxll, romsubxlh, romsubxhl and romsubxhh (banks no. x = 0 to 7) registers. after each register store , when the cpu address matches the value stored in the romcmpx0 to romcmpx2 (banks no. x = 0 to 7) registers, the program patch logic disables rd output to the internal rom and drives out the code stored in the romsubxll to romsubxhh (banks no. x = 0 to 7) to the internal bus. the cpu thus fetches the patch code. the following shows some examples: examples: a. replacing 00h at address ff1230h with aah 7 6 5 4 3210 romcmp00 0 0 1 1 0000 stores 30h in address compare register 0 for bank0. romcmp01 0 0 0 1 0010 stores 12h in address compare register 1 for bank0. romcmp02 1 1 1 1 1111 stores ffh in address compare register 2 for bank0. romsub0ll 1 0 1 0 1010 store aah in address substitution register ll for bank0. romsub0lh 0 0 0 1 0001 store 11h in address substitution register lh for bank0. romsub0hl 0 0 1 0 0010 store 22h in address substitution register hl for bank0. romsub0hh 0 0 1 1 0011 store 33h in address substitution register hh for bank0. figure 3.15.18 example patch code implementation internal i/o internal ram external area internal rom 00h re p lace with 11h ff1230h ff1231h ff1232h ff1233h re p lace with aah ffffffh a ff0000h 002000h 000000h re p lace with 22h replace with 33h (11h, 22h and 33h same as current value) 11h 22h 33h vector table
tmp92cy23/cd23a 2009-08-28 92cy23-319 b. replacing 33h at address ff1233h with bbh 7 6 5 4 3 2 1 0 romcmp00 0 0 1 1 0 0 0 0 stores 30h in address compare register 0 for bank0. romcmp01 0 0 0 1 0 0 1 0 stores 12h in address compare register 1 for bank0. romcmp02 1 1 1 1 1 1 1 1 stores ffh in address compare register 2 for bank0. romsub0ll 0 0 0 0 0 0 0 0 store 00h in address substitution register ll for bank0 romsub0lh 0 0 0 1 0 0 0 1 store 11h in address substitution register lh for bank0 romsub0hl 0 0 1 0 0 0 1 0 store 22h in address substitution register hl for bank0. romsub0hh 1 0 1 1 1011 store bbh in address substitution register hh for bank0. figure 3.15.19 example patch code implementation internal i/o internal ram external area internal rom 00h re p lace with 11h ff1230h ff1231h ff1232h ff1233h re p lace with 00h ffffffh b ff0000h 002000h 000000h replace with 22h replace with bbh (00h, 11h and 22h same as current value ) 11h 22h 33h vector table
tmp92cy23/cd23a 2009-08-28 92cy23-320 c. replacing 00h at address ff1230h with aah, 11h at address ff1231h with bbh, 22h at address ff1232h with cch and 33h at address ff1233h with ddh 7 6 5 4 3210 romcmp00 0 0 1 1 0000 stores 30h in address compare register 0 for bank0. romcmp01 0 0 0 1 0010 stores 12h in address compare register 1 for bank0. romcmp02 1 1 1 1 1111 stores ffh in address compare register 2 for bank0. romsub0ll 1 0 1 0 1010 store aah in address substitution register ll for bank0 romsub0lh 1 0 1 1 1011 store bbh in address substitution register lh for bank0. romsub0hl 1 1 0 0 1100 store cch in address substitution register hl for bank0. romsub0hh 1 1 0 1 1101 store ddh in address substitution register hh for bank0. figure 3.15.20 example patch code implementation internal i/o internal ram external area internal rom 00h re p lace with bbh ff1230h ff1231h ff1232h ff1233h re p lace with aah ffffffh c ff0000h 002000h 000000h re p lace with cch re p lace with ddh 11h 22h 33h vector table
tmp92cy23/cd23a 2009-08-28 92cy23-321 d. replacing 11h at address ff1231h with aah, 22h at address ff1232h with bbh, 33h at address ff1233h with cch and 44h at address ff1234h with ddh (requiring two banks) 7 6 5 4 3210 romcmp00 0 0 1 1 0000 stores 30h in address compare register 0 for bank0. romcmp01 0 0 0 1 0010 stores 12h in address compare register 1 for bank0. romcmp02 1 1 1 1 1111 stores ffh in address compare register 2 for bank0. romsub0ll 0 0 0 0 0000 store 00h in address substitution register ll for bank0 romsub0lh 1 0 1 0 1010 store aah in address substitution register lh for bank0. romsub0hl 1 0 1 1 1011 store bbh in address substitution register hl for bank0 romsub0hh 1 1 0 0 1100 store cch in address substitution register hh for bank0 romcmp10 0 0 1 1 0100 stores 34h in address compare register 0 for bank1. romcmp11 0 0 0 1 0010 stores 12h in address compare register 1 for bank1. romcmp12 1 1 1 1 1111 stores ffh in address compare register 2 for bank1. romsub1ll 1 1 0 1 1101 store ddh in address substitution register ll for bank1 romsub1lh 0 1 0 1 0101 store 55h in address substitution register lh for bank1 romsub1hl 0 1 1 0 0110 store 66h in address substitution register hl for bank1. romsub1hh 0 1 1 1 0111 store 77h in address substitution register hh for bank1. figure 3.15.21 example patch code implementation internal i/o internal ram external area internal rom 00h re p lace with aah ff1230h ff1231h ff1232h ff1233h ff1234h ff1235h ff1236h ff1237h re p lace with 00h ffffffh d ff0000h 002000h 000000h re p lace with bbh re p lace with cch 11h 22h 33h vector table 44h 55h 66h 77h re p lace with ddh re p lace with 55h re p lace with 66h replace with 77h (00h, 55h, 66h and 77h same as current value)
tmp92cy23/cd23a 2009-08-28 92cy23-322 (2) using an interrupt to cause a branch a wider range of program code can also be fixed using a software interrupt (swi). with a patch code loaded into on-chip ram, the program patch logic can be used to replace program code at a specified address with a single-byte swi instruction, which causes a branch to the patch program. note that this method can only be used if the original rom data has been developed with on-chip ram addresses specified as swi vector addresses . correction procedure: load the address compare regist ers romcmpx0 to romcmpx2 (x = bank no. 0 to 7) with the start address of the program code that is to be fixed. if it is an even address, store an swi instruction code (e.g., swi: f9h) in romsubxll or romsubxhl. if the start address is an odd address, store an swi instruction code in romsubxlh or romsubxhh. when the data for the purpose of substitution is required only for 1 to 3 bytes, please set the same data as original rom data to the remaining data. when the cpu address matches the value stored in the romcmpx0 to romcmpx2 registers, the program patch logic disables rd output to the internal rom and drives out the swi instruction code to the internal bus. upon fetching the swi code, the cpu makes a branch to the internal ram area to execute the preloaded code. at the end of the patch program executed from the internal ram, the cpu directly rewrites the saved pc value so that it points to the address following the patch code, and then executes a reti. the following shows an example: example: fixing a program within the range from ff5000h to ff507fh before developing the original rom data, set the swi1 vector reference address to 002500h (on-chip ram area). use the startup routine to load the patch code to on-chip ram (002500h to 0025efh). store the start address (ff5000h) of the rom area to be fixed in the romcmp00 to romcmp02. store the swi1 instruction code (f9h) in the romsub0ll and the current data at ff5001h (aah) in the romsub0lh and the current data at ff5002h (bbh) in the romsub0hl and the current data at ff5003 (cch) in the romsub0hh. when the cpu address matches the value stored in romcmp00 to romcmp02, the program patch logic replaces the rom-based code at ff5000h with f9h. the cpu then executes the swi1 instruction, which causes a branch to 002500h in the on-chip ram area. after executing the patch program the cpu finally rewrites the saved pc value to ff5080h and executes a reti.
tmp92cy23/cd23a 2009-08-28 92cy23-323 figure 3.15.22 example patch code implementation internal i/o internal ram external area internal rom aah sw1 vector re p lace the start address with f9h ( swi1 instruction code ) replace with aah defective area 002000h 000000h ff5001h ff5000h ffff04h ffff07h ffff00h vector table 002500h patch program 002800h ? ? ? ? branch caused by sw1 return from int 002500h 0025efh program body ? ? ? rewrite stack reti 002500h 0025efh ff5002h ff5003h replace with bbh replace with cch (aah, bbh and cch same as current value) bbh cch 55h ~ ff507fh ff5080h ff0000h
tmp92cy23/cd23a 2009-08-28 92cy23-324 4. electrical characteristics 4.1 absolute maximum ratings parameter symbol rating unit power supply voltage v cc ? 0.5 to 4.0 v input voltage v in ?0.5 to v cc + 0.5 v output current (1 pin) except pn1, pn2, pn4 and pn5 i ol 2 ma output current (1 pin) pn1, pn2, pn4 and pn5 i ol2 3.5 ma output current (1 pin) i oh ?2 ma output current (total) i ol 80 ma output current (total) i oh ?80 ma power dissipation (ta = 85 c) p d 600 mw soldering temperature (10 s) t solder 260 c storage temperature t stg ?65 to 150 c operation temperature t opr ?40 to 85 c note: the absolute maximum ratings ar e rated values which must not be exceeded during operation, even for an instant. any one of the ratings must not be exceeded. if any absolute maximum rati ng is exceeded, the device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. thus, when designing products which include this device, ensure that no absolute maximum rating value will ever be exceeded. solderability te s t parameter test condition note (1) use of sn-37pb solder bath solder bath temperature =230 c, dipping time = 5 seconds the number of times = one, use of r-type flux solderability (2) use of sn-3.0ag-0.5cu solder bath solder bath temperature =245 c, dipping time = 5 seconds the number of times = one, use of r-type flux pass: solderability rate until forming 95%
tmp92cy23/cd23a 2009-08-28 92cy23-325 4.2 dc electrical characteristics (1/2) v cc = 3.3 0.3v/fc = 6 to 40 mhz/ta = ? 40 to 85 c parameter symbol min typ. max unit condition power supply voltage (dvcc = avcc) (dvss = avss = 0v) (tmp92cy23) x1 = 6 to 10 mhz (at the time of pll use) x1 = 6 to 40 mhz (at the time of pll un-use) xt1 = 30 to 34 khz v cc 3.0 3.6 v (tmp92cd23a) x1 = 6 to 10 mhz xt1 = 30 to 34khz input low voltage for p00 to p07 (d0 to d7) p10 to p17 (d8 to d15) v il0 0.6 input low voltage for p40 to p47 (a0 to a7) p50 to p57 (a8 to a15) p60 to p67 (a16 to a23) p76, p77 p80 to p82 v il1 0.3 v cc input low voltage for p70 to p73, p83 pc0 to pc3, pd0 to pd4 pf0 to pf5, pg0 to pg7 pl0 to pl3, pn0, pn3 v il2 0.25 v cc reset , nmi , p74(int0) v il2a 0.2 v cc input low voltage for am0, am1 v il3 0.3 input low voltage for x1, xt1(p76) v il4 0.2 v cc input low voltage for pn1, pn2, pn4, pn5 v il5 ?0.3 0.3 v cc v input high voltage for p00 to p07 (d0 to d7) p10 to p17 (d8 to d15) v ih0 2.0 v input high voltage for p40 to p47 (a0 to a7) p50 to p57 (a8 to a15) p60 to p67 (a16 to a23) p76, p77, p80 to p82 v ih1 0.7 v cc input high voltage for p70 to p73, p83 pc0 to pc3, pd0 to pd4 pf0 to pf5, pg0 to pg7 pl0 to pl3, pn0, pn3 v ih2 0.75 v cc reset , nmi , p74(int0) v ih2a 0.8 v cc input high voltage for am0, am1 v ih3 v cc ? 0.3 input high voltage for x1, xt1(p76) v ih4 0.8 v cc v cc + 0.3 input high voltage for pn1, pn2, pn4, pn5 v ih5 0.7 v cc 5.5
tmp92cy23/cd23a 2009-08-28 92cy23-326 v cc = 3.3 0.3v/fc = 6 to 40 mhz/ta = ? 40 to 85 c parameter symbol min typ. max unit condition output low voltage v ol 0.45 i ol = 1.6 ma output low voltage for pn1, pn2, pn4, pn5 v ol2 0.4 i ol = 3.0 ma output high voltage v oh 2.4 v i oh = ?400 a input leakage current i li 0.02 5 0.0 Q vin Q v cc output leakage current i lo 0.05 10 a 0.2 Q vin Q v cc ? 0.2 power down voltage at stop (for stop, ram back-up) v stop 1.8 3.6 v v il2 = 0.2 v cc , v ih2 = 0.8 v cc pull-up resistor for reset r rst programmable pull-up resistor for p70 to p73 r kh 80 500 k pin capacitance c io 10 pf fc = 1 mhz schmitt width for p70 to p73, p83 pc0 to pc3, pd0 to pd4 pf0 to pf5, pg0 to pg7 pl0 to pl3, pn0 to pn5 reset , p74(int0) v th 0.2 v normal (note 2) i cc 34 60 idle2 mode i ccidle2 15 26 idle1 mode i ccidle1 4 9 ma f c = 40 mhz f sys = 20 mhz slow (note 2) i cc 30 110 slow ? idle2 mode i ccidle2 15 80 slow ? idle1 mode i ccidle1 8 60 xt1 = 32.768 khz (f sys = 16.384 khz) tmp92cy23 stop i ccstop 0.2 50 a normal (note 2) i cc 50 70 idle2 mode i ccidle2 18 26 idle1 mode i ccidle1 4 9 ma f c = 40 mhz f sys = 20 mhz slow (note 2) i cc 55 130 slow ? idle2 mode i ccidle2 30 100 slow ? idle1 mode i ccidle1 20 90 xt1 = 32.768 khz (f sys = 16.384 khz) tmp92cd23a stop i ccstop 0.8 50 a note 1: typical values are for when ta = 25c and v cc = 3.3 v unless otherwise noted. note 2: i cc measurement conditions (normal, slow): all functions are operational; output pins are opened and input pins are fixed. c l = 30 pf is loaded to data and address bus.
tmp92cy23/cd23a 2009-08-28 92cy23-327 4.3 ac characteristics 4.3.1 basic bus cycle read cycle v cc = 3.3 0.3v/fc = 6 to 40 mhz/ta = ? 40 to 85 c variable no. parameter symbol min max f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) unit 1 osc period (x1/x2) t osc 25 25 37.0 ns 2 system clock period ( = t) t cyc 50 50 74.0 ns 3 clk low width t cl 0.5t ? 15 10 22 ns 4 clk high width t ch 0.5t ? 15 10 22 ns 5-1 a0 to a23 valid d0 to d15 input at 0 wait t ad 2.0t ? 50 50 98 ns 5-2 a0 to a23 valid d0 to d15 input at 1 wait t ad3 3.0t ? 50 100 172 ns 6-1 rd falling d0 to d15 input at 0 wait t rd 1.5t ? 45 30 66 ns 6-2 rd rising d0 to d15 input at 1 wait t rd3 2.5t ? 45 80 140 ns 7-1 rd low width at 0 wait t rr 1.5t ? 20 55 91 ns 7-2 rd low width at 1 wait t rr3 2.5t ? 20 105 165 ns 8 a0 to a23 valid rd rising t ar 0.5t ? 20 5 17 ns 9 rd falling clk falling t rk 0.5t ? 20 5 17 ns 10 a0 to a23 valid d0 to d15 hold t ha 0 0 0 ns 11 rd rising d0 to d15 hold t hr 0 0 0 ns 12 wait set-up time t tk 20 20 20 ns 13 wait hold time t kt 5 5 5 ns 14 data byte control access time for sram t sba 1.5t ? 45 30 66 ns 15 rd high width t rrh 0.5t ? 15 10 22 ns write cycle v cc = 3.3 0.3v/fc = 6 to 40 mhz/ta = ? 40 to 85 c variable no. parameter symbol min max f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) unit 16 srwr falling clk falling t swk 0.5t ? 20 5 17 ns 17 srwr rising a0 to a23 hold t swa 0.25t ? 5 7.5 13.5 ns 18 rd rising d0 to d15 output t rdo 0.5t ? 5 20 32 ns 19 write pulse width for sram t swp 1.25t ? 30 32.5 62.5 ns 20 data byte control to end of write for sram t sbw 1.25t ? 30 32.5 62.5 ns 21 address setup time for sram t sas 0.5t ? 20 5 17 ns 22 write recovery time for sram t swr 0.25t ? 5 7.5 13.5 ns 23 data setup time for sram t sds 1.25t ? 35 27.5 57.5 ns 24 data hold time for sram t sdh 0.25t ? 5 7.5 13.5 ns ac measuring condition output: high = 0.7 v cc , low = 0.3 v cc , c l = 50 pf input: high = 0.9 v cc , low = 0.1 v cc
tmp92cy23/cd23a 2009-08-28 92cy23-328 (1) read cycle (0 waits, fc = f osch , f fph = fc/1) note: the phase relation between x1 input signal and the other signals is undefined. the above timing chart is an example . clk t cl t tk t ad t h a wait a 0 to a23 x1 t osc 0cs to 3cs t cyc t ch t kt t ar t rk t hr t rr d0 to d15 data input rd t rd srllb , srlub t sb a srwr
tmp92cy23/cd23a 2009-08-28 92cy23-329 (2) write cycle (0 waits, fc = f osch , f fph = fc/1) note: the phase relation between x1 input signal and the other signals is undefined. the above timing char t is an example. x1 clk a 0 to a23 d0 to d15 wait rd data output t osc t cl t ch t cyc t tk t kt t sw a t rdo 0cs to 3cs t sbw t sds t swp t sas srwr t swr t sdh srllb , srlub t swk
tmp92cy23/cd23a 2009-08-28 92cy23-330 (3) read cycle (1 wait, fc = f osch , f fph = fc/1) (4) write cycle (1 wait, fc = f osch , f fph = fc/1) a 0 to a23 wait data in p ut t rd3 t rr3 t ad3 clk d0 to d15 rd 0cs to 3cs a 0 to a23 wait data out p ut clk d0 to d15 rd t rdo srwr 0cs to 3cs
tmp92cy23/cd23a 2009-08-28 92cy23-331 4.3.2 page rom read cycle (1) 3-2-2-2 mode v cc = 3.3 0.3 v/fc = 6 to 40 mhz/ta = ? 40 to 85c variable no. parameter symbol min max f sys = 20mhz (fc = 40 mhz) f sys = 18mhz (fc = 36 mhz) f sys = 13.5mhz (fc = 27 mhz) unit 1 system clock period ( = t) t cyc 50 50 55.5 74 ns 2 a0, a1 d0 to d15 input t ad2 2.0t ? 50 50 61 98 ns 3 a2 to a23 d0 to d15 input t ad3 3.0t ? 50 100 116.5 172 ns 4 rd falling d0 to d15 input t rd3 2.5t ? 45 80 93.8 140 ns 5 a0 to a23 valid d0 to d15 hold t ha 0 0 0 0 ns 6 rd rising d0 to d15 hold t hr 0 0 0 0 ns ac measuring condition ? output: high = 0.7 v cc , low = 0.3 v cc , cl = 50 pf ? input: high = 0.9 v cc , low = 0.1 v cc timing pulse diagram (8-byte setting) clk a0 to a23 2cs rd d0 to d15 + 0 + 1 + 2 + 3 data input data input data input data input t ad3 t ad2 t ad2 t ad2 t h a t hr t rd3 t h a t h a t h a t cyc
tmp92cy23/cd23a 2009-08-28 92cy23-332 4.3.3 serial channel timing (1) sclk input mode (i/o interface mode) variable f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) parameter symbol min max min max min max unit sclk cycle t scy 16x 0.40 0.59 s output data sclk rising/falling * t oss t scy /2 ? 4x ? 70 30 78 ns sclk rising/falling * output data hold t ohs t scy /2 + 2x + 0 250 370 ns sclk rising/falling * input data hold t hsr 3x + 10 85 121 ns sclk rising/falling * input data valid t srd t scy ? 0 400 592 ns input data valid sclk rising/falling * t rds 0 0 0 ns * : sclk rinsing/falling edge: the rising edge is used in sclk rising mode. the falling edge is used in sclk falling mode. note 1: t scy = 16x at f sys = 20mhz or 13.5mhz note 2: symbol x in the above table means the period of clock f fph , it?s half period of the system clock f sys for cpu core. the period of f fph depends on the clock gear setting. (2) sclk output mode (i/o interface mode) variable f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) parameter symbol min max min max min max unit sclk cycle t scy 16x 8192x 0.40 204 0.59 303 s output data sclk rising/falling * t oss t scy /2 ? 40 160 256 ns sclk rising/falling * output data hold t ohs t scy /2 ? 40 160 256 ns sclk rising/falling * input data hold t hsr 0 0 0 ns sclk rising/falling * input data valid t srd t scy ? 1x ? 180 195 375 ns input data valid sclk rising/falling * t rds 1x + 180 205 217 ns * : sclk rinsing/falling edge: the rising edge is used in sclk rising mode. the falling edge is used in sclk falling mode. note 1: t scy = 16x at f sys = 20mhz or 13.5mhz note 2: symbol x in the above table means the period of clock f fph , it?s half period of the system clock f sys for cpu core. the period of f fph depends on the clock gear setting. t sc y 0 sclk output mode/ input rising mode sclk (input falling mode) output data txd 1 2 3 t oss t ohs input data rxd 0 1 2 3 t srd t rds t hsr valid valid valid valid
tmp92cy23/cd23a 2009-08-28 92cy23-333 4.3.4 high speed sio timing (high speed sio function is not built into tmp92cy23) variable symbol parameter min max f sys = 20mhz (fc = 40 mhz) f sys = 18mhz (fc = 36 mhz) f sys = 13.5mhz (fc = 27 mhz) unit f pp hsclk frequency ( = 1/x) 10 10 9 6.75 mhz t r hsclk rising timing 8 8 8 8 t f hsclk falling time 8 8 8 8 t wl hsclk low pulse width 0.5x-8 42 47 66 t wh hsclk high pulse width 0.5x-16 34 39 58 t ods1 output data valid hsclk rise 0.5x-18 32 37 56 t ods2 output data valid hsclk fall 0.5x-23 27 32 51 t odh hsclk rise/fall output data hold 0.5x-10 40 45 64 t ids input data valid hsclk rise/fall 0x+20 20 20 20 t idh hsclk rise/fall input data hold 0x+5 5 5 5 ns ac measuring conditions output level : high = 0.7 v cc , low = 0.2 v cc , c l = 25 pf input level : high = 0.9 v cc , low = 0.1 v cc hsclk output hsso output f pp 0.2v cc 0.7v cc hssi input hsclk output (when hsmd= ?11?) (when hsmd= ?00?)
tmp92cy23/cd23a 2009-08-28 92cy23-334 4.3.5 interrupts variable f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) parameter symbol min max min max min max unit nmi , int0 to int7 low level width t intal 4x + 40 140 188 nmi , int0 to int7 high level width t intah 4x + 40 140 188 ns note : symbol x in the above t able means the period of clock f fph , it?s half period of the system clock f sys for cpu core. the period of f fph depends on the clock gear setting. 4.3.6 event counter (ta0in, tb1in0, tb1in1) variable f sys = 20 mhz (fc = 40 mhz) f sys = 13.5mhz (fc = 27 mhz) parameter symbol min max min max min max unit clock period t vck 8x + 100 300 396 ns clock low level width t vckl 4x + 40 140 188 ns clock high level width t vckh 4x + 40 140 188 ns note : symbol x in the above t able means the period of clock f fph , it?s half period of the system clock f sys for cpu core. the period of f fph depends on the clock gear setting. 4.4 ad conversion characteristics parameter symbol min typ. max unit ad converter power supply voltage avcc vcc vcc vcc ad converter gnd avss vss vss vss analog input voltage avin avss avcc v total error (quantize error of 0.5lsb is included) e t 1.0 4.0 lsb note 1: 1lsb = (avcc ? avss) / 1024 [v] note 2: minimum frequency for operation ad converter operatinon is guaranteed only when using fc (high-frequency oscill ator). fs is not guaranteed. however, operation is guaranteed if the clock frequenc y selected by the clock gear is over 4mhz,. note 3: the value for i cc includes the current which flows through the avcc pin.
tmp92cy23/cd23a 2009-08-28 92cy23-335 4.5 recommended oscillation circuit the tmp92cy23/cd23a has been evaluated by the oscillator vender below. use this information when selecting external parts. note: the total load value of the oscillator is the sum of ex ternal loads (c1 and c2) and th e floating load of the actual assembled board. there is a possibility of operating error when using c1 and c2 values in the table below. when designing the board, design the mi nimum length pattern around the oscillator. we also recommend that oscillator evaluation be carried out using the actual board. (1) connection example figure 4.5.1 high-frequenc y oscillator figure 4.5. 2 low-frequency oscillator (2) tmp92cy23/cd23a recommend ed ceramic oscillator tmp92cy23/cd23a recommends the high-frequency oscillator by murata manufacturing co., ltd. please refer to the following url http://www.murata.com x1 x2 rd rf c2 c1 xt1 xt2 rd c2 c1
tmp92cy23/cd23a 2009-08-28 92cy23-336 5. table of special function registers (sfrs) the sfrs include the i/o ports and peripheral control registers allocated to the 8-kbyte address space from 000000h to 001fffh. (1) i/o port (9) uart/serial channel (2) interrupt control (10) i 2 cbus/serial channel (3) dma controller (11) ad converter (4) memory controller (12) watchdog timer (5) clock control/pll (13) special timer for clock (6) 8-bit timer (14) key-on wake up (7) 16-bit timer (15) program patch function (8) high speed serial channel (note) note: high speed serial channel funti on is not built into tmp92cy23. table layout symbol name address 7 6 1 0 bit symbol read/write initial value after reset remarks note: ?prohibit rmw? in the table means that yo u cannot use rmw instructions on these registers. example: when setting bit0 only of the register pxcr, the in struction ?set 0, (pxcr)? cannot be used. the ld (transfer) instruction must be used to write all eight bits. read/write r/w: both read and write are possible. r: only read is possible. w: only write is possible. w * : both read and write are possible (when this bit is read as1) prohibit rmw: read-modify-write instructio ns are prohibited. (the ex, add, adc, bus, sbc, inc, dec, and, or, xo r, stcf, res, set, chg, tset, rlc, rrc, rl, rr, sla, sra, sll, srl, rld and rrd instruction are read modify write instructions.) r/w *: read-modify-write is prohibited when controlling the pull-up resistor.
tmp92cy23/cd23a 2009-08-28 92cy23-337 table 5.1 i/o register address map [1] port address name address name address name address name 0000h p0 0010h p4 0020h p8 0030h pc 1h 1h 1h p8fc2 1h 2h p0cr 2h p4cr 2h p8cr 2h pccr 3h p0fc 3h p4fc 3h p8fc 3h pcfc 4h p1 4h p5 4h 4h pd 5h 5h 5h 5h pdfc2 6h p1cr 6h p5cr 6h 6h pdcr 7h p1fc 7h p5fc 7h 7h pdfc 8h 8h p6 8h 8h 9h 9h 9h 9h ah ah p6cr ah ah bh bh p6fc bh bh ch ch p7 ch ch pf dh dh dh dh pffc2 eh eh p7cr eh eh pfcr fh fh p7fc fh fh pffc address name address name 0040h pg 0050h 1h 1h 2h 2h 3h pgfc 3h 4h 4h pl 5h 5h 6h 6h 7h 7h plfc 8h 8h 9h 9h ah ah bh bh ch ch pn dh dh eh eh pncr fh fh pnfc note: do not access no allocated name address.
tmp92cy23/cd23a 2009-08-28 92cy23-338 [2] intc [3] dma controller address name address name address name address name 00d0h inte01 00e0h intetb0 00f0h inttc01 0100h dma0v 1h inte23 1h intestbo0 1h inttc23 1h dma1v 2h inte45 2h intetb1 2h inttc45 2h dma2v 3h inte67 3h intstbo1 3h inttc67 3h dma3v 4h inteta01 4h intepad 4h hscsel (note) 4h dma4v 5h inteta23 5h intertc 5h simc 5h dma5v 6h inteta45 6h 6h iimc 6h dma6v 7h reserved 7h 7h 7h dma7v 8h intes0 8h 8h intclr 8h dmab 9h intes1hsc 9h 9h reserved 9h dmar ah intes2 ah ah iimc2 ah reserved bh reserved bh bh iimc3 bh ch intesb0 ch ch reserved ch dh intesb1 dh dh reserved dh eh reserved eh eh reserved eh fh reserved fh intenmwdt fh reserved fh note: hscsel register is not built into tmp92cy23. [4] memory controller [5] clock control/pll address name address name address name address name 0140h b0csl 0150h reserved 0160h reserved 10e0h syscr0 1h b0csh 1h reserved 1h reserved 1h syscr1 2h mamr0 2h reserved 2h reserved 2h syscr2 3h msar0 3h reserved 3h 3h emccr0 4h b1csl 4h reserved 4h 4h emccr1 5h b1csh 5h reserved 5h 5h emccr2 6h mamr1 6h reserved 6h pmemcr 6h 7h msar1 7h reserved 7h 7h 8h b2csl 8h bexcsl 8h 8h pllcr0 9h b2csh 9h bexcsh 9h 9h pllcr1 ah mamr2 ah reserved ah ah bh msar2 bh reserved bh bh ch b3csl ch ch reserved ch dh b3csh dh dh dh eh mamr3 eh eh eh fh msar3 fh fh fh note: do not access no allocated name address.
tmp92cy23/cd23a 2009-08-28 92cy23-339 [6] 8-bit timer [7] 16-bit timer address name address name address name address name 1100h ta01run 1110h ta45run 1180h tb0run 1190h tb1run 1h 1h 1h 1h 2h ta0reg 2h ta4reg 2h tb0mod 2h tb1mod 3h ta1reg 3h ta5reg 3h tb0ffcr 3h tb1ffcr 4h ta01mod 4h ta45mod 4h 4h 5h ta1ffcr 5h ta5ffcr 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h ta23run 8h 8h tb0rg0l 8h tb1rg0l 9h 9h 9h tb0rg0h 9h tb1rg0h ah ta2reg ah ah tb0rg1l ah tb1rg1l bh ta3reg bh bh tb0rg1h bh tb1rg1h ch ta23mod ch ch tb0cp0l ch tb1cp0l dh ta3ffcr dh dh tb0cp0h dh tb1cp0h eh eh eh tb0cp1l eh tb1cp1l fh fh fh tb0cp1h fh tb1cp1h [8] high speed serial channel (note2) [8] uart/sio address name address name address name address name 0c00h hsc0md 0c10h hsc0td 1200h sc0buf 1210h sc2buf 1h hsc0md 1h hsc0td 1h sc0cr 1h sc2cr 2h hsc0ct 2h hsc0rd 2h sc0mod0 2h sc2mod0 3h hsc0ct 3h hsc0rd 3h br0cr 3h br2cr 4h hsc0st 4h hsc0ts 4h br0add 4h br2add 5h hsc0st 5h hsc0ts 5h sc0mod1 5h sc2mod1 6h hsc0cr 6h hsc0rs 6h 6h 7h hsc0cr 7h hsc0rs 7h sir0cr 7h sir2cr 8h hsc0is 8h 8h sc1buf 8h 9h hsc0is 9h 9h sc1cr 9h ah hsc0we ah ah sc1mod0 ah bh hsc0we bh bh br1cr bh ch hsc0ie ch ch br1add ch dh hsc0ie dh dh sc1mod1 dh eh hsc0ir eh eh eh fh hsc0ir fh fh sir1cr fh note1: do not access no allocated name address. note2: this function is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-340 [9] i 2 c bus/sio [10] ad converter [11] watch dog timer address name address name address name address name 1240h sbi0cr1 12a0h adreg0l 12b0h adreg8l 1300h wdmod 1h sbi0dbr 1h adreg0h 1h adreg8h 1h wdcr 2h i2c0ar 2h adreg1l 2h adreg9l 2h 3h sbi0cr2/sbi0sr 3h adreg1h 3h adreg9h 3h 4h sbi0br0 4h adreg2l 4h adregal 4h 5h sbi0br1 5h adreg2h 5h adregah 5h 6h 6h adreg3l 6h adregbl 6h 7h 7h adreg3h 7h adregbh 7h 8h sbi1cr1 8h adreg4l 8h admod0 8h 9h sbi1dbr 9h adreg4h 9h admod1 9h ah i2c1ar ah adreg5l ah admod2 ah bh sbi1cr2/sbi1sr bh adreg5h bh reserved bh ch sbi1br0 ch adreg6l ch reserved ch dh sbi1br1 dh adreg6h dh dh eh eh adreg7l eh eh fh fh adreg7h fh fh [12] special timer for clock [13] key-on wake up address name address name 1310h rtccr 13a0h kien 1h 1h kicr 2h 2h 3h 3h 4h 4h 5h 5h 6h 6h 7h 7h 8h 8h 9h 9h ah ah bh bh ch ch dh dh eh eh fh fh note: do not access no allocated name address.
tmp92cy23/cd23a 2009-08-28 92cy23-341 [14] program patch function address name address name address name address name 1400h romcmp00 1410h romcmp20 1420h romcmp40 1430h romcmp60 1h romcmp01 1h romcmp21 1h romcmp41 1h romcmp61 2h romcmp02 2h romcmp22 2h romcmp42 2h romcmp62 3h 3h 3h 3h 4h romsub0ll 4h romsub2ll 4h romsub4ll 4h romsub6ll 5h romsub0lh 5h romsub2lh 5h romsub4lh 5h romsub6lh 6h romsub0hl 6h romsub2hl 6h romsub4hl 6h romsub6hl 7h romsub0hh 7h romsub2hh 7h romsub4hh 7h romsub6hh 8h romcmp10 8h romcmp30 8h romcmp50 8h romcmp70 9h romcmp11 9h romcmp31 9h romcmp51 9h romcmp71 ah romcmp12 ah romcmp32 ah romcmp52 ah romcmp72 bh bh bh bh ch romsub1ll ch romsub3ll ch romsub5ll ch romsub7ll dh romsub1lh dh romsub3lh dh romsub5lh dh romsub7lh eh romsub1hl eh romsub3hl eh romsub5hl eh romsub7hl fh romsub1hh fh romsub3hh fh romsub5hh fh romsub7hh note: do not access no allocated name address.
tmp92cy23/cd23a 2009-08-28 92cy23-342 (1) i/o ports (1/4) symbol name address 7 6 5 4 3 2 1 0 p07 p06 p05 p04 p03 p02 p01 p00 r/w p0 port 0 0000h data from external port (output latch register is cleared to ?0?) p17 p16 p15 p14 p13 p12 p11 p10 r/w p1 port 1 0004h data from external port (output latch register is cleared to ?0?) p47 p46 p45 p44 p43 p42 p41 p40 r/w p4 port 4 0010h data from external port (output latch register is cleared to ?0?) p57 p56 p55 p54 p53 p52 p51 p50 r/w p5 port 5 0014h data from external port (output latch register is cleared to ?0?) p67 p66 p65 p64 p63 p62 p61 p60 r/w p6 port 6 0018h data from external port (output latch register is cleared to ?0?) p77 p76 p74 p73 p72 p71 p70 r/w r r/w data from external port (output latch register is set to ?1?) data from external port data from external port (output latch register is set to ?1?) p7 port 7 001ch ? ? 0 (output latch register): pull-up resistor off 1 (output latch register): pull-up resistor on p83 p82 p81 p80 r/w p8 port 8 0020h data from external port (output latch register is set to ?1?) 0 1 1 pc3 pc2 pc1 pc0 r pc port c 0030h data from external port pd4 pd3 pd2 pd1 pd0 r/w r r/w pd port d 0034h data from external port (note 1) data from external port data from external port (note 1) pf5 pf4 pf3 pf2 pf1 pf0 r/w pf port f 003ch data from external port (output latch register is cleared to ?0?) pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 r pg port g 0040h data from external port (note 2) pl3 pl2 pl1 pl0 r pl port l 0054h data from external port (note 2) pn5 pn4 pn3 pn2 pn1 pn0 r/w pn port n 005ch data from external port (output latch register is set to ?1?) note1: output latch register is cleared to ?0?. (there is no output latch register.) note2: it operates as an analog input port.(input port disable)
tmp92cy23/cd23a 2009-08-28 92cy23-343 i/o ports (2/4) symbol name address 7 6 5 4 3 2 1 0 p07c p06c p05c p04c p03c p02c p01c p00c w 0 0 0 0 0 0 0 0 p0cr port 0 control register 0002h (prohibit rmw) 0: input 1: output p 0 0 f w 0 p0fc port 0 function register 0003h (prohibit rmw) 0:port 1:data bus (d0 to d7) p17c p16c p15c p14c p13c p12c p11c p10c w 0 0 0 0 0 0 0 0 p1cr port 1 control register 0006h (prohibit rmw) 0: input 1: output p 1 0 f w 0 p1fc port 1 function register 0007h (prohibit rmw) 0:port 1:data bus (d8 to d15) p47c p46c p45c p44c p43c p42c p41c p40c w 0 0 0 0 0 0 0 0 p4cr port 4 control register 0012h (prohibit rmw) 0: input 1: output p47f p46f p45f p44f p43f p42f p41f p40f w 0 0 0 0 0 0 0 0 p4fc port 4 function register 0013h (prohibit rmw) 0: port 1: address bus (a0 to a7) p57c p56c p55c p54c p53c p52c p51c p50c w 0 0 0 0 0 0 0 0 p5cr port 5 control register 0016h (prohibit rmw) 0: input 1: output p57f p56f p55f p54f p53f p52f p51f p50f w 0 0 0 0 0 0 0 0 p5fc port 5 function register 0017h (prohibit rmw) 0: port 1: address bus (a8 to a15) p67c p66c p65c p64c p63c p62c p61c p60c w 0 0 0 0 0 0 0 0 p6cr port 6 control register 001ah (prohibit rmw) 0: input 1: output p67f p66f p65f p64f p63f p62f p61f p60f w 0 0 0 0 0 0 0 0 p6fc port 6 function register 001bh (prohibit rmw) 0: port 1: address bus (a16 to a23) note1: when port p70 to p73 is used in the input mode, p7 register controls the built-in pull-up resistor. read-modify-write is prohibited in the input mode or the i/o mode. setting the built-in pull-up resistor may be depended on the states of the input pin. note 2: notes on using low-frequency resonator to p76,p77, it is necessary to set the following procedures to reduce the consumption power supply. ? connecting to a resonator set p7cr=?11?,p7=?00?. ? connectiion to an oscillator set p7cr=?11?,p7=?10?.
tmp92cy23/cd23a 2009-08-28 92cy23-344 i/o ports (3/4) symbol name address 7 6 5 4 3 2 1 0 p77c p76c p73c p72c p71c p70c w w 1 1 0 0 0 0 p7cr port 7 control register 001eh (prohibit rmw) 0: input 1: output 0: input 1: output p74f p73f p72f p71f p70f w 0 0 0 0 0 p7fc port 7 function register 001fh (prohibit rmw) 0: port input 1: int0 input 0: port 1: srlub 0: port 1: srllb 0: port 1: srwr 0: port 1: rd p83f2 p81f2 p80f2 w w 0 0 0 p8fc2 port 8 function register 2 0021h (prohibit rmw) 0: 1: ta5out 0: 1: ta3out 0: 1: ta1out p83c w 1 p8cr port 8 control register 0022h (prohibit rmw) 0: input 1: output p83f p82f p81f p80f w 0 0 0 0 p8fc port 8 function register 0023h (prohibit rmw) 00:port input 01:port output 10: wait input 11: 3cs output 0: port 1: cs2 0: port 1: cs1 0: port 1: cs0 pc3f pc2f pc1f pc0f w 0 0 0 0 pcfc port c function register 0033h (prohibit rmw) 0: port 1: int3 0: port 1: int2 0: port 1: int1 0: port 1: ta0in pd4f2 pd3f2 pd2f2 pd1f2 w 0 0 0 0 pdfc2 port d function register 2 0035h (prohibit rmw) pd4c pd3c pd2c pd0c w w 0 0 0 0 pdcr port d control register 0036h (prohibit rmw) 0: input 1: output 0: input 1: output pd4f pd3f pd2f pd1f pd0f w 0 0 0 0 0 pdfc port d function register 0037h (prohibit rmw) pd4 pd3 pd2 pd1 pd0 000 input port input port input port input port input port 001 output port output port output port output port 010 reserved rxd2 tb1in1 tb1in0 int4 011 tb1out1 tb1out0 txd2 (3-state) tb0out0 100 sclk2 input 2 cts input int7 int6 int5 101 sclk2 outpu t reserved reserved 110 reserved reserved reserved reserved 111 reserved reserved txd2 (open drain )
tmp92cy23/cd23a 2009-08-28 92cy23-345 i/o ports (4/4) symbol name address 7 6 5 4 3 2 1 0 pf2f2 w 0 pffc2 port f function register 2 003dh (prohibit rmw) 0: 1: clk pf5c pf4c pf3c pf2c pf1c pf0c w 0 0 0 0 0 0 pfcr port f control register 003eh (prohibit rmw) 0: input 1: output pf5f pf4f pf3f pf2f pf1f pf0f w 0 0 0 0 0 0 pffc (note10) port f function register 003fh (prohibit rmw) pf2 pf1 pf0 000 input port input port input port 001 output port output port output port 010 sclk0 input 0 cts input rxd0 txd0 (open drain) 011 sclk0 output reserved txd0 (3-state) 100 reserved reserved reserved 101 clk output reserved reserved 110 reserved reserved reserved 111 reserved reserved reserved pf5 pf4 pf3 0000 input port input port input port 0001 output port output port output port 0010 sclk1 input 1 cts input rxd1 txd1 (open drain) 0011 sclk1 output reserved txd1 (3-state) 1000 reserved reserved reserved 1001 reserved reserved reserved 1010 reserved hssi input reserved 1011 hsclk output reserved hsso(3-stage) pg7f pg6f pg5f pg4f pg3f pg2f pg1f pg0f w 1 1 1 1 1 1 1 1 pgfc port g control register 0043h (prohibit rmw) 0:port/key input 1: analog input pl3f pl2f pl1f pl0f w 1 1 1 1 plfc port l function register 0057h (prohibit rmw) 0: port input 1: analog input pn5c pn4c pn3c pn2c pn1c pn0c w 0 0 0 0 0 0 pncr port n control register 005eh (prohibit rmw) 0: input 1: output pn5f pn4f pn3f pn2f pn1f pn0f w 0 0 0 0 0 0 pnfc port n function register 005fh (prohibit rmw) pn5 pn4 pn3 pn2 pn1 pn0 00 input port input port input port input port input port input port 01 output port output port output port output port output port output port 10 si1 input so1 output sck1 input si0 input so0 output sck0 input 11 scl1i/o sda1 i/o sck1 output scl0 i/o sda0 i/o sck0 output note 1: when using p83 as a wait input, while setting it as p8cr = ?0? and p8fc = ?1?, it is necessary to set memory control register bxcsl or as ?011?. note 2: when setting p80 to p83 as a standard chip select signal ( 0 cs to 3 cs ) output, p8cr is set up after setting up p8fc. note 3: pc0 is not based on a functional setup of a po rt, but is inputted into ta0in of a 8-bit timer (tmra0) note 4: tb1in0 and tb1in1 input is inputted into the 16-bit ti mer tmrb1 irrespective of a functional setup of a port.
tmp92cy23/cd23a 2009-08-28 92cy23-346 note 5: rxd2, sclk2 input, and cts2 input are inputted into the serial channel 2 irrespective of a functional setup of a port. note 6: pd2 does not have a register for 3-state / open drain setup. moreover, there is no open drain function at the time of an output port. note 7: pf0 and pf3 does not have a register for 3-state / open drain setup. moreover, there is no open drain function at the time of an output port. note8: input channel selection of an ad converter in pg0 to pg7 and pl0 to pl3 is set up by ad mode control register admod1 . moreover, a setup of ad trigger ( adtrg ) input permission is set up by admod2 . note9: specify the hscsel when selecting tx d1 or hsso, rxd1 or hssi and sclk1 or hsclk. note10: hsso, hssi, hsclk and are not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-347 (2) interrupt control (1/4) symbol name address 7 6 5 4 3 2 1 0 int1 int0 i1c i1m2 i1m1 i1m0 i0c i0m2 i0m1 i0m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte01 int0 & int1 enable 00d0h 1: int1 interrupt request level 1: int0 interrupt request level int3 int2 i3c i3m2 i23m1 i3m0 i2c i2m2 i2m1 i2m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte23 int2 & int3 enable 00d1h 1: int3 interrupt request level 1: int2 interrupt request level int5 int4 i5c i5m2 i5m1 i5m0 i4c i4m2 i4m1 i4m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte45 int4 & int5 enable 00d2h 1: int5 interrupt request level 1: int4 interrupt request level int7 int6 i7c i7m2 i7m1 i7m0 i6c i6m2 i6m1 i6m0 r r/w r r/w 0 0 0 0 0 0 0 0 inte67 int6 & int7 enable 00d3h 1: int7 interrupt request level 1: int6 interrupt request level intta1 (tmra1) intta0 (tmra0) ita1c ita1m2 ita1m1 ita1m0 it a0c ita0m2 ita0m1 ita0m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta01 intta0 & intta1 enable 00d4h 1: intta1 interrupt request level 1: intta0 interrupt request level intta3 (tmra3) intta2 (tmra2) ita3c ita3m2 ita3m1 ita3m0 it a2c ita2m2 ita2m1 ita2m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta23 intta2 & intta3 enable 00d5h 1: intta3 interrupt request level 1: intta2 interrupt request level intta5 (tmra5) intta4 (tmra4) ita5c ita5m2 ita5m1 ita5m0 it a4c ita4m2 ita4m1 ita4m0 r r/w r r/w 0 0 0 0 0 0 0 0 inteta45 intta4 & intta5 enable 00d6h 1: intta5 interrupt request level 1: intta4 interrupt request level inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes0 intrx0 & inttx0 enable 00d8h 1: inttx0 interrupt request level 1: intrx0 interrupt request level inttx1/inthsc (note) intrx1 itx1c itx1m2 itx1m1 itx1m0 irx1c irx1m2 irx1m1 irx1m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes1hsc intrx1 & inttx1/ inthsc enable 00d9h 1: inttx1 interrupt request level 1: intrx1 interrupt request level inttx2 intrx2 itx2c itx2m2 itx2m1 itx2m0 irx2c irx2m2 irx2m1 irx2m0 r r/w r r/w 0 0 0 0 0 0 0 0 intes2 intrx2 & inttx2 enable 00dah 1: inttx2 interrupt request level 1: intrx2 interrupt request level note: inthsc interrupt is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-348 interrupt control (2/4) symbol name address 7 6 5 4 3 2 1 0 ? intsbe0 ? ? ? ? isbe0c isbe0m2 isbe0m1 isbe0m0 ? ? r r/w ? ? ? ? 0 0 0 0 intesb0 intsbe0 enable 00dch always write ?0? 1: intsbe0 interrupt request level ? intsbe1 ? ? ? ? isbe1c isbe1m2 isbe1m1 isbe1m0 ? ? r r/w ? ? ? ? 0 0 0 0 intesb1 intsbe1 enable 00ddh always write ?0? 1: intsbe1 interrupt request level inttb01 (tmrb0) inttb00 (tmrb0) itb01c itb01m2 itb01m1 itb01m0 itb00c itb00m2 itb00m1 itb00m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetb0 inttb00 & inttb01 enable 00e0h 1: inttb01 interrupt request level 1: inttb00 interrupt request level ? inttbo0 (tmrb0) ? ? ? ? itbo0c itbo0m2 itbo0m1 itbo0m0 ? ? r r/w ? ? ? ? 0 0 0 0 intetbo0 inttbo0 (overflow) enable 00e1h always write ?0? 1: inttbo0 interrupt request level inttb11 (tmrb1) inttb10 (tmrb1) itb11c itb11m2 itb11m1 itb11m0 itb10c itb10m2 itb10m1 itb10m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetb1 inttb10 & inttb11 enable 00e2h 1: inttb11 interrupt request level 1: inttb10 interrupt request level ? inttbo1 (tmrb1) ? ? ? ? itbo1c itbo1m2 itbo1m1 itbo1m0 ? ? r r/w ? ? ? ? 0 0 0 0 intetbo1 inttbo1 (overflow) enable 00e3h always write ?0? 1: inttbo1 interrupt request level intp0 intad ip0c ip0m2 ip0m1 ip0m0 iadc iadm2 iadm1 iadm0 r r/w r r/w 0 0 0 0 0 0 0 0 intepad intp0& intad enable 00e4h 1: intp0 interrupt request level 1: intad interrupt request level ? intrtc ? ? ? ? irc irm2 irm1 irm0 ? ? r r/w ? ? ? ? 0 0 0 0 intertc intrtc enable 00e5h always write ?0? 1: intrtc interrupt request level nmi intwdt incnm ? ? ? incwd ? ? ? r r 0 ? ? ? 0 ? ? ? intnmwdt nmi & intwd enable 00efh 1: nmi always write ?0? 1: intwdt always write ?0?
tmp92cy23/cd23a 2009-08-28 92cy23-349 interrupt control (3/4) symbol name address 7 6 5 4 3 2 1 0 inttc1 (dma1) inttc0 (dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc01 inttc0 & inttc1 enable 00f0h 1: inttc1 interrupt request level 1: inttc0 interrupt request level inttc3 (dma3) inttc2 (dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc23 inttc2 & inttc3 enable 00f1h 1: inttc3 interrupt request level 1: inttc2 interrupt request level inttc5 (dma5) inttc4 (dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc45 nttc4 & inttc5 enable 00f2h 1: inttc5 interrupt request level 1: inttc4 interrupt request level inttc7 (dma7) inttc6 (dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w 0 0 0 0 0 0 0 0 intetc67 nttc6 & inttc7 enable 00f3h 1: inttc7 interrupt request level 1: inttc6 interrupt request level
tmp92cy23/cd23a 2009-08-28 92cy23-350 interrupt control (4/4) symbol name address 7 6 5 4 3 2 1 0 ? ? ? ? ? ? ? siocnt r r/w 0 0 0 0 0 0 0 0 hscsel hsc selection register 00f4h 0: sio1 1: hsc ? ir2le ir1le ir0le w w 0 1 1 1 simc sio interrupt mode control register 00f5h (prohibit rmw) always write ?1?. intrx2 0: edge mode 1: level mode intrx1 0: edge mode 1: level mode intrx0 0: edge mode 1: level mode nmiree w 0 iimc interrupt input mode control register 00f6h (prohibit rmw) nmi 0:falling 1:falling and rising i7le i6le i5le i4le i3le i2le i1le i0le w 0 0 0 0 0 0 0 0 iimc2 interrupt input mode control register2 00fah (prohibit rmw) int7 0: edge 1: level int6 0: edge 1: level int5 0: edge 1: level int4 0: edge 1: level int3 0: edge 1: level int2 0: edge 1: level int1 0: edge 1: level int0 0: edge 1: level i7edge i6edge i5edge i4edge i3edge i2edge i1edge i0edge w 0 0 0 0 0 0 0 0 iimc3 interrupt input mode control register3 00fbh (prohibit rmw) int7 0: rising /high 1: falling /low int6 0: rising /high 1: falling /low int5 0: rising /high 1: falling /low int4 0: rising /high 1: falling /low int3 0: rising /high 1: falling /low int2 0: rising /high 1:falling /low int1 0: rising /high 1: falling /low int0 0: rising /high 1: falling /low clrv7 clrv6 clrv5 clrv4 clrv3 clrv2 clrv1 clrv0 w 0 0 0 0 0 0 0 0 intclr interrupt clear control register 00f8h (prohibit rmw) clear the interrupt request flag by the writing of a micro dma starting vector note: hscsel register is not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-351 (3) dma controller symbol name address 7 6 5 4 3 2 1 0 dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w 0 0 0 0 0 0 dma0v dma0 start vector 0100h dma0 start vector dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w 0 0 0 0 0 0 dma1v dma1 start vector 0101h dma1 start vector dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w 0 0 0 0 0 0 dma2v dma2 start vector 0102h dma2 start vector dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w 0 0 0 0 0 0 dma3v dma3 start vector 0103h dma3 start vector dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w 0 0 0 0 0 0 dma4v dma4 start vector 0104h dma4 start vector dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w 0 0 0 0 0 0 dma5v dma5 start vector 0105h dma5 start vector dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w 0 0 0 0 0 0 dma6v dma6 start vector 0106h dma6 start vector dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w 0 0 0 0 0 0 dma7v dma7 start vector 0107h dma7 start vector dbst7 dbst6 dbst5 dbst4 dbst3 dbst2 dbst1 dbst0 r/w 0 0 0 0 0 0 0 0 dmab dma burst 0108h 1: dma request on burst mode dreq7 dreq6 dreq5 dreq4 dre q3 dreq2 dreq1 dreq0 r/w 0 0 0 0 0 0 0 0 dmar dma request 0109h (prohibit rmw) 1: dma request in software
tmp92cy23/cd23a 2009-08-28 92cy23-352 (4) memory controller (1/2) symbol name address 7 6 5 4 3 2 1 0 b0ww2 b0ww1 b0ww0 b0wr2 b0wr1 b0wr0 w w 0 1 0 0 1 0 write waits read waits 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin b0csl block 0 memc control register low 0140h (prohibit rmw) others: reserved others: reserved b0e b0rec b0om1 b0om0 b0bus1 b0bus0 w w 0 0 0 0 0 0 b0csh block 0 memc control register high 0141h (prohibit rmw) cs select 0: disable 1: enable 0: not insert a dummy cycle 1: insert a dummy cycle 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8-bit 01: 16-ibt 10: reserved 11: reserved b1ww2 b1ww1 b1ww0 b1wr2 b1wr1 b1wr0 w w 0 1 0 0 1 0 write waits read waits 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin b1csl block 1 memc control register low 0144h (prohibit rmw) others: reserved others: reserved b1e b1rec b1om1 b1om0 b1bus1 b1bus0 w w 0 0 0 0 0 0 b1csh block 1 memc control register high 0145h (prohibit rmw) cs select 0:disable 1:enable 0: not insert a dummy cycle 1: insert a dummy cycle 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8-bit 01: 16-ibt 10: reserved 11: reserved b2ww2 b2ww1 b2ww0 b2wr2 b2wr1 b2wr0 w w 0 1 0 0 1 0 write waits read waits 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin b2csl block 2 memc control register low 0148h (prohibit rmw) others: reserved others: reserved b2e b2m b2rec b2om1 b2om0 b2bus1 b2bus0 w w 1 0 0 0 0 0/1 (note) 0/1 (note) b2csh block 2 memc control register high 0149h (prohibit rmw) cs select 0:disable 1:enable 0:16 mb 1: sets area 0: not insert a dummy cycle 1: insert a dummy cycle 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8-bit 01: 16-ibt 10: reserved 11: reserved note: since after reset becomes unfixed, please be sure to set up bus bit b2csh of the control register before accessing the external block address area 2.
tmp92cy23/cd23a 2009-08-28 92cy23-353 memory controller (2/3) symbol name address 7 6 5 4 3 2 1 0 b3ww2 b3ww1 b3ww0 b3wr2 b3wr1 b3wr0 w w 0 1 0 0 1 0 write waits read waits 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin b3csl block 3 memc control register low 014ch (prohibit rmw) others: reserved others: reserved b3e b3rec b3om1 b3om0 b3bus1 b3bus0 w w 0 0 0 0 0 0 b3csh block 3 memc control register high 014dh (prohibit rmw) cs select 0:disable 1:enable 0: not insert a dummy cycle 1: insert a dummy cycle 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8-bit 01: 16-ibt 10: reserved 11: reserved bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 w w 0 1 0 0 1 0 write waits read waits 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin 001: 0 wait 101: 2 wait 111: 4 wait 010: 1 wait 110: 3 wait 011: wait pin bexcsl block ex memc control register low 0158h (prohibit rmw) others: reserved others: reserved bexrec bexom1 bexom0 bexbus1 bexbus0 w 0 0 0 0 0 bexcsh block ex memc control register high 0159h (prohibit rmw) 0: not insert a dummy cycle 1: insert a dummy cycle 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8-bit 01: 16-ibt 10: reserved 11: reserved opge opwr1 opwr0 pr1 pr0 r/w 0 0 0 1 0 pmemcr page rom control register 0166h rom page access 0: disable 1: enable wait number on page 00:1 state (n-1-1-1 mode) 01:2 state (n-2-2-2 mode) 10:3 state (n-3-3-3 mode) 11:reserved byte number in a page 00:64 byte 01:32 byte 10:16 byte 11:8 byte
tmp92cy23/cd23a 2009-08-28 92cy23-354 memory controller (3/3) symbol name address 7 6 5 4 3 2 1 0 m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14-9 m0v8 r/w 1 1 1 1 1 1 1 1 mamr0 memory mask register 0 0142h 0: compare enable 1: compare disable m0s23 m0s22 m0s21 m0s20 m0s19 m0s18 m0s17 m0s16 r/w 1 1 1 1 1 1 1 1 msar0 memory start address register 0 0143h set start address a23 to a16 m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 mv15-9 m1v8 r/w 1 1 1 1 1 1 1 1 mamr1 memory mask register 1 0146h 0: compare enable 1: compare disable m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 r/w 1 1 1 1 1 1 1 1 msar1 memory start address register 1 0147h set start address a23 to a16 m2v22 m2v21 m2v20 m2v19 m2v18 m2v17 m2v16 m2v15 r/w 1 1 1 1 1 1 1 1 mamr2 memory mask register 2 014ah 0: compare enable 1: compare disable m2s23 m2s22 m2s21 m2s20 m2s19 m2s18 m2s17 m2s16 r/w 1 1 1 1 1 1 1 1 msar2 memory start address register 3 014bh set start address a23 to a16 m3v22 m3v21 m3v20 m3v19 m3v18 m3v17 m3v16 m3v15 r/w 1 1 1 1 1 1 1 1 mamr3 memory mask register 3 014eh 0: compare enable 1: compare disable m3s23 m3s22 m3s21 m3s20 m3s19 m3s18 m3s17 m3s16 r/w 1 1 1 1 1 1 1 1 msar3 memory start address register 3 014fh set start address a23 to a16
tmp92cy23/cd23a 2009-08-28 92cy23-355 (5) clock control/pll (1/2) symbol name address 7 6 5 4 3 2 1 0 xen xten wuef r/w r/w 1 0 0 syscr0 system clock control register 0 10e0h high- frequency oscillator (f osch ) 0: stop 1: oscillation low- frequency oscillator (fs) 0: stop 1: oscillation warm-up timer 0: write don?t care 1: write start timer 0: read end warm-up 1: read do not end warm-up sysck gear2 gear1 gear0 r/w 0 1 0 0 syscr1 system clock control register 1 10e1h select system clock 0: fc 1: fs select gear value of high-frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (reserved) 110: (reserved) 111: (reserved) ? wuptm1 wuptm0 haltm1 haltm0 drve w r/w r/w 0 1 0 1 1 0 syscr2 system clock control register 2 10e2h always write ?0? warm-up timer 00: reserved 01: 2 8 /input frequency 10: 2 14 /input frequency 11: 2 16 /input frequency halt mode 00: reserved 01: stop mode 10: idle1 mode 11: idle2 mode 1: the inside of stop mode also drives a pin fcsel lupfg r/w r 0 0 pllcr0 pll control register 0 10e8h select fc clock 0: f osch 1: f pll lock up timer status flag 0: not end 1: end pllon r/w 0 pllcr1 pll control register 1 10e9h control on/off 0: off 1: on
tmp92cy23/cd23a 2009-08-28 92cy23-356 clock control/pll (2/2) symbol name address 7 6 5 4 3 2 1 0 protect extin ? drvoscl r r/w 0 0 1 1 emccr0 (note1) emc control register 0 10e3h protect flag 0: off 1: on 1: external clock always write ?1? fs oscillator driver ability 1: normal 0: weak protect ? ? drvoscl r r/w 0 0 1 1 emccr0 (note2) emc control register 0 10e3h protect flag 0: off 1: on always write ?0? always write ?1? fs oscillator driver ability 1: normal 0: weak emccr1 emc control register 1 10e4h emccr2 emc control register 2 10e5h switch the protect on/off by writing the following to 1st-key, 2nd-key 1st-key: write in sequence emccr1 = 5ah, emccr2 = a5h 2nd-key: write in sequence emccr1 = a5h, emccr2 = 5ah note1: this register is a register for tmp92cy23. note2: this register is a register for tmp92cd23a.
tmp92cy23/cd23a 2009-08-28 92cy23-357 (6) 8-bit timer (1/2) symbol name address 7 6 5 4 3 2 1 0 ta0rde i2ta01 ta01prun ta1run ta0run r/w r/w 0 0 0 0 0 tmra01 prescaler uc1 uc0 ta01run 8-bit timer run register 1100h double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? w ta0reg 8-bit timer register 0 1102h (prohibit rmw) undefined ? w ta1reg 8-bit timer register 1 1103h (prohibit rmw) undefined ta01m1 ta01m0 pwm01 pwm00 ta1clk1 ta1clk0 ta0clk1 ta0clk0 r/w 0 0 0 0 0 0 0 0 ta01mod 8-bit timer source clk & mode register 1104h operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra1 00: ta0trg 01: t1 10: t16 11: t256 source clock for tmra0 00: ta0in pin input 01: t1 10: t4 11: t16 ta1ffc1 ta1ffc0 ta1ffie ta1ffis r/w r/w 1 1 0 0 ta1ffcr 8-bit timer flip-flop control register 1105h (prohibit rmw) 00: invert ta1ff 01: set ta1ff 10: clear ta1ff 11: don?t care ta1ff control for inversion 0: disable 1: enable ta1ff inversion select 0: tmra0 1: tmra1 ta2rde i2ta23 ta23prun ta3run ta2run r/w r/w 0 0 0 0 0 tmra23 prescaler uc3 uc2 ta23run 8-bit timer run register 1108h double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? w ta2reg 8-bit timer register 2 110ah (prohibit rmw) undefined ? w ta3reg 8-bit timer register 3 110bh (prohibit rmw) undefined ta23m1 ta23m0 pwm21 pwm20 ta3clk1 ta3clk0 ta2clk1 ta2clk0 r/w 0 0 0 0 0 0 0 0 ta23mod 8-bit timer source clk & mode register r 110ch operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra3 00: ta2trg 01: t1 10: t16 11: t256 source clock for tmra2 00: reserved 01: t1 10: t4 11: t16 ta3ffc1 ta3ffc0 ta3ffie ta3ffis r/w r/w 1 1 0 0 ta3ffcr 8-bit timer flip-flop control register 110dh (prohibit rmw) 00: invert ta3ff 01: set ta3ff 10: clear ta3ff 11: don?t care ta3ff control for inversion 0: disable 1: enable ta3ff inversion select 0: tmra2 1: tmra3
tmp92cy23/cd23a 2009-08-28 92cy23-358 8-bit timer (2/2) symbol name address 7 6 5 4 3 2 1 0 ta4rde i2ta45 ta45prun ta5run ta4run r/w r/w 0 0 0 0 0 tmra45 prescaler uc5 uc4 ta45run 8-bit timer run register 1110h double buffer 0: disable 1: enable idle4 0: stop 1: operate 0: stop and clear 1: run (count up) ? w ta4reg 8-bit timer register 4 1112h (prohibit rmw) undefined ? w ta5reg 8-bit timer register 5 1113h (prohibit rmw) undefined ta45m1 ta45m0 pwm41 pwm40 ta5clk1 ta5clk0 ta4clk1 ta4clk0 r/w 0 0 0 0 0 0 0 0 ta45mod 8-bit timer source clk & mode register 1114h operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra5 00: ta4trg 01: t1 10: t16 11: t256 source clock for tmra4 00: reserved 01: t1 10: t4 11: t16 ta5ffc1 ta5ffc0 ta5ffie ta5ffis r/w r/w 1 1 0 0 ta5ffcr 8-bit timer flip-flop control register 1115h (prohibit rmw) 00: invert ta5ff 01: set ta5ff 10: clear ta5ff 11: don?t care ta5ff control for inversion 0: disable 1: enable ta5ff inversion select 0: tmra4 1: tmra5
tmp92cy23/cd23a 2009-08-28 92cy23-359 (7) 16-bit timer (1/2) symbol name address 7 6 5 4 3 2 1 0 tb0rde ? i2tb0 tb0prun tb0run r/w r/w r/w 0 0 0 0 0 tmrb0 prescaler up counter (uc0) tb0run 16-bit timer run register 1180h double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? ? tb0cp0i tb0cpm1 tb0cpm0 tb0cle tb0clk1 tb0clk0 r/w w r/w 0 0 1 0 0 0 0 0 tb0mod 16-bit timer source clk & mode register 1182h (prohibit rmw) always write ?0? software capture control 0: software capture 1: undefined capture timing 00: disable 01: reserved 10: reserved 11:ta1out ta1out up counter control 0: disable 1: enable tmrb0 source clock 00: reserved 01: t1 10: t4 11: t16 ? ? tb0c1t1 tb0c0t1 tb0e1t1 tb0e0t1 tb0ffc1 tb0ffc0 w * r/w w * 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: disable trigger 1: enable trigger tb0ffcr 16-bit timer flip-flop control register 1183h (prohibit rmw) always write ?11?. invert when the uc value is loaded in to tb0cp1h/l invert when the uc value is loaded in to tb0cp0h/l invert when the uc value matches the value in tb0rg1h/l invert when the uc value matches the value in tb0rg0h/l control tb0ff0 00: invert 01: set 10: clear 11: don?t care * always read as 11. ? w tb0rg0l 16-bit timer register 0 low 1188h (prohibit rmw) undefined ? w tb0rg0h 16-bit timer register 0 high 1189h (prohibit rmw) undefined ? w tb0rg1l 16-bit timer register 1 low 118ah (prohibit rmw) undefined ? w tb0rg1h 16-bit timer register 1 high 118bh (prohibit rmw) undefined ? r tb0cp0l 16-bit timer capture register 0low 118ch undefined ? r tb0cp0h 16-bittimer capture register 0 high 118dh undefined ? r tb0cp1l 16-bit timer capture register 1 low 118eh undefined ? r tb0cp1h 16-bit timer capture register 1 high 118fh undefined
tmp92cy23/cd23a 2009-08-28 92cy23-360 16-bittimer (2/2) symbol name address 7 6 5 4 3 2 1 0 tb1rde ? i2tb1 tb1prun tb1run r/w r/w r/w 0 0 0 0 0 tmrb1 prescaler up counter (uc1) tb1run 16-bit timer run register 1190h double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) tb1ct1 tb1et1 tb1cp0i tb1cpm1 tb1cpm0 tb1cle tb1clk1 tb1clk0 r/w w r/w 0 0 1 0 0 0 0 0 tb1ff1 inversion trigger 0: trigger disable 1: trigger enable tb1mod 16-bit timer source clk & mode register 1192h (prohibit rmw) invert when capture to capture register 1 invert when match uc0 with tb1rg1h/l software capture control 0: software capture 1: undefined capture timing 00: disable int5 is rising edge 01: tb1n0 tb1in1 int5 is rising edge 10: tb1in0 tb1in0 int5 is falling edge 11: ta3out ta3out int5 is rising edge up counter control 0: disable 1: enable tmrb1 source clock 00: tb1in0 pin input 01: t1 10: t4 11: t16 tb1ff1c1 tb1ff1c0 tb1c1t1 tb1c0t1 tb1e1t1 tb1e0t1 tb1ffc1 tb1ffc0 w * r/w w * 1 1 0 0 0 0 1 1 tb1ff0 inversion trigger 0: disable trigger 1: enable trigger tb1ffcr 16-bit timer flip-flop control register 1193h (prohibit rmw) tb1ff1 control 00: invert 01: set 10: clear 11: don?t care * always read as ?11?. invert when the uc value is loaded in to tb1cp1h/l invert when the uc value is loaded in to tb1cp0h/l invert when the uc value matches the value in tb1rg1h/l. invert when the uc value matches the value in tb1rg0h/l. control tb1ff0 00: invert 01: set 10: clear 11: don?t care * always read as 11. ? w tb1rg0l 16-bit timer register 0 low 1198h (prohibit rmw) undefined ? w tb1rg0h 16-bit timer register 0 high 1199h (prohibit rmw) undefined ? w tb1rg1l 16-bit timer register 1 low 119ah (prohibit rmw) undefined ? w tb1rg1h 16-bit timer register 1 high 119bh (prohibit rmw) undefined ? r tb1cp0l 16-bit timer capture register 0 low 119ch undefined ? r tb1cp0h 16-bittimer capture register 0 high 119dh undefined ? r tb1cp1l 16-bit timer capture register 1 low 119eh undefined ? r tb1cp1h 16-bit timer capture register 1 high 119fh undefined
tmp92cy23/cd23a 2009-08-28 92cy23-361 (8) high speed serial (note)(1/3) symbol name address 7 6 5 4 3 2 1 0 xen0 clksel02 clksel01 clksel00 r/w r/w 0 1 0 0 0c00h sysck 0: disable 1: enable select baud rate 000:reserved 100:f sys /16 001: f sys /2 101: f sys /32 010: f sys /4 110: f sys /64 011: f sys /8 111:reserved loopback0 msb1st0 dostat0 tcpol0 rcpol0 tdinv0 rdinv0 r/w r/w 0 1 1 0 0 0 0 hsc0md high speed serial mode register 0c01h loopback test mode 0: disable 1: enable start bit for transmit /receive 0:lsb 1:msb hsso pin (no transmit) 0: fixed to ?0? 1:fixed to ?1? synchronous clock edge during transmitting 0: fall 1: rise synchronous clock edge during receiving 0: fall 1: rise invert data during transmitting 0:disable 1:enable invert data during receiving 0:disable 1:enable unit160 algnen0 rxwen0 rxuen0 r/w r/w 0 1 0 0 0 0 0c02h always write ?0? always write ?1? data length 0: 8bit 1: 16bit full duplex alignment 0:disable 1:enable sequential receive 0:disable 1:enable receive unit 0:disable 1:enable crc16_7_b0 c rcrx_tx_b 0 crcrest_b0 dmaerfw0 dmaerfr0 r/w r/w 0 0 0 0 0 hsc0ct high speed serial control register 0c03h crc select 0:crc7 1:crc16 crc data 0:transmit 1:receive crc calculate register 0: reset 1:release reset micro dma 0: disable 1: enable micro dma 0: disable 1: enable tend0 rend0 rfw0 rfr0 r 1 0 1 0 0c04h t r a n s m i t t i n g 0:operation 1: no operation receive shift register 0: no data 1: exist data transmit buffer 0: untransmitted data exist 1: no untransmitted data receive buffer 0: no valid data 1: valid data exist hsc0st high speed serial status register 0c05h crcd007 crcd006 crcd005 crcd004 crcd003 crcd002 crcd001 crcd000 r 0 0 0 0 0 0 0 0 0c06h crc calculation result load register[7:0] crcd015 crcd014 crcd013 crcd012 crcd011 crcd010 crcd009 crcd008 r 0 0 0 0 0 0 0 0 hsc0cr high speed serial crc register 0c07h crc calculation result load register[15:8] note: high speed serial function in not built into tmp92cy23.
tmp92cy23/cd23a 2009-08-28 92cy23-362 high speed serial (2/3) symbol name address 7 6 5 4 3 2 1 0 tendis0 rendis0 rfwis0 rfris0 r / w 0 0 0 0 0c08h read 0: no interrupt 1: interrupt write 0: don?t care 1: clear read 0: no interrupt 1: interrupt write 0: don?t care 1: clear read 0: no interrupt 1: interrupt write 0: don?t care 1: clear read 0: no interrupt 1: interrupt write 0: don?t care 1: clear hsc0is high speed serial interrupt status register 0c09h tendwe0 rendwe0 rfwwe0 rfrwe0 r / w 0 0 0 0 0c0ah clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable clear hsc0is 0: disable 1: enable hsc0we high speed serial interrupt status write enable register 0c0bh tendie0 rendie0 rfwie0 rfrie0 r / w 0 0 0 0 0c0ch tend0 interrupt 0: disable 1: enable rend0 interrupt 0: disable 1: enable rfw0 interrupt 0: disable 1: enable rfr0 interrupt 0: disable 1: enable hsc0ie high speed serial interrupt enable register 0c0dh tendir0 rendir0 rfwir0 rfrir0 r 0 0 0 0 0c0eh tend0 interrupt 0: none 1: generate rend0 interrupt 0: none 1: generate rfw0 interrupt 0: none 1: generate rfr0 interrupt 0: none 1:generate hsc0ir high speed serial interrupt request register 0c0fh
tmp92cy23/cd23a 2009-08-28 92cy23-363 high speed serial (3/3) symbol name address 7 6 5 4 3 2 1 0 txd007 txd006 txd005 txd004 txd003 txd002 txd001 txd000 r/w 0 0 0 0 0 0 0 0 0c10h transmission data register [7:0] txd015 txd014 txd013 txd012 txd011 txd010 txd009 txd008 r/w 0 0 0 0 0 0 0 0 hsc0td high speed serial transmission data register 0c11h transmission data register [15:8] rxd007 rxd006 rxd005 rxd004 rxd003 rxd002 rxd001 rxd000 r/w 0 0 0 0 0 0 0 0 0c12h receive data register [7:0] rxd015 rxd014 rxd013 rxd012 rxd011 rxd010 rxd009 rxd008 r/w 0 0 0 0 0 0 0 0 hsc0rd high speed serial receiving data register 0c13h receive data register [15:8] tsd007 tsd006 tsd005 tsd004 tsd003 tsd002 tsd001 tsd000 r/w 0 0 0 0 0 0 0 0 0c14h transmit data shift register [7:0] tsd015 tsd014 tsd013 tsd012 tsd011 tsd010 tsd009 tsd008 r/w 0 0 0 0 0 0 0 0 hsc0ts high speed serial transmit data shift register 0c15h transmit data shift register [15:8] rsd007 rsd006 rsd005 rsd004 rsd003 rsd002 rsd001 rsd000 r/w 0 0 0 0 0 0 0 0 0c16h receive data shift register [7:0] rsd015 rsd014 rsd013 rsd012 rsd011 rsd010 rsd009 rsd008 r/w 0 0 0 0 0 0 0 0 hsc0rs high speed serial receive data shift register 0c17h receive data shift register [15:8]
tmp92cy23/cd23a 2009-08-28 92cy23-364 (9) uart/serial channel (1/3) symbol name address 7 6 5 4 3 2 1 0 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 r b3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r (receive)/w (transmission) sc0buf serial channel 0 buffer register 1200h (prohibit rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (cleared to 0 when read) r/w undefined 0 0 0 0 0 0 0 1: error sc0cr serial channel 0 control register 1201h received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0:sclk0 1:sclk0 0: baud rate generator 1: sclk0 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w 0 0 0 0 0 0 0 0 sc0mod0 serial channel 0 mode0 register 1202h transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clcok (sclk0 input) ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 r/w 0 0 0 0 0 0 0 0 br0cr serial channel 0 baud rate control register 1203h always write ?0?. + (16 ? k) /16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting br0k3 br0k2 br0k1 br0k0 r / w 0 0 0 0 br0add serial channel 0 k setting register 1204h sets frequency divisor ?k? (divided by n + (16 ? k)/16). i2s0 fdpx0 r/w 0 0 sc0mod1 serial channel 0 mode1 register 1205h idle2 0: stop 1: run duplex 0: half 1: full plsel rxsel txen rxen sir0wd3 sir0wd2 sir0wd1 sir0wd0 r/w 0 0 0 0 0 0 0 0 sir0cr irda control register 0 1207h select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width for equal or more than 2x (value + 1) + 100 ns can be set: 1 to 14 can not be set: 0, 15
tmp92cy23/cd23a 2009-08-28 92cy23-365 uart/serial channel (2/3) symbol name address 7 6 5 4 3 2 1 0 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 r b3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r (receive)/w (transmission) sc1buf serial channel 1 buffer register 1208h (prohibit rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (cleared to 0 when read) r/w undefined 0 0 0 0 0 0 0 1: error sc1cr serial channel 1 control register 1209h received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0:sclk1 1:sclk1 0: baud rate generator 1: sclk1 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w 0 0 0 0 0 0 0 0 sc1mod0 serial channel 1 mode0 register 120ah transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clock (sclk1 input) ? br1adde br1ck1 br1ck0 br1s3 br1s2 br1s1 br1s0 r/w 0 0 0 0 0 0 0 0 br1cr serial channel 1 baud rate control register 120bh always write ?0?. + (16 ? k) /16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting br1k3 br1k2 br1k1 br1k0 r/w 0 0 0 0 br1add serial channel 1 k setting register 120ch sets frequency divisor ?k? (divided by n + (16 ? k)/16). i2s1 fdpx1 r/w 0 0 sc1mod1 serial channel 1 mode1 register 120dh idle2 0: stop 1: run duplex 0: half 1: full plsel rxsel txen rxen sir1wd3 sir1wd2 sir1wd1 sir1wd0 r/w 0 0 0 0 0 0 0 0 sir1cr irda control register 1 120fh select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width for equal or more than 2x (value + 1) + 100 ns can be set: 1 to 14 can not be set: 0, 15
tmp92cy23/cd23a 2009-08-28 92cy23-366 uart/serial channel (3/3) symbol name address 7 6 5 4 3 2 1 0 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 r b3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r (receive)/w (transmission) sc2buf serial channel 2 buffer register 1210h (prohibit rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (cleared to 0 when read) r/w undefined 0 0 0 0 0 0 0 1: error sc2cr serial channel 2 control register 1211h received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0:sclk2 1:sclk2 0: baud rate generator 1: sclk2 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w 0 0 0 0 0 0 0 0 sc2mod0 serial channel 2 mode0 register 1212h transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f sys 11: external clock (sclk2 input) ? br2adde br2ck1 br2ck0 br2s3 br2s2 br2s1 br2s0 r/w 0 0 0 0 0 0 0 0 br2cr serial channel 2 baud rate control register 1213h always write ?0?. + (16 ? k) /16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting br2k3 br2k2 br2k1 br2k0 r/w 0 0 0 0 br2add serial channel 2 k setting register 1214h sets frequency divisor ?k? (divided by n + (16 ? k)/16). i2s2 fdpx2 r/w 0 0 sc2mod1 serial channel 2 mode1 register 1215h idle2 0: stop 1: run duplex 0: half 1: full plsel rxsel txen rxen sir2wd3 sir2wd2 sir2wd1 sir2wd0 r/w 0 0 0 0 0 0 0 0 sir2cr irda control register 2 1217h select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width for equal or more than 2x (value + 1) + 100 ns can be set: 1 to 14 can not be set: 0, 15
tmp92cy23/cd23a 2009-08-28 92cy23-367 (10) i 2 c bus/serial channel (1/4) symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon w r/w w r/w 0 0 0 0 0 0 0/1 number of transferred bits setting of the divide value ?n? 001: 6 100: 9 010: 7 101: 10 1240h (i 2 c bus mode) (prohibit rmw) 000: 8 011: 3 110: 6 001: 1 100: 4 111: 7 010: 2 101: 5 acknowledge mode 0: disable 1: enable 000: 5 011: 8 110: 11 111: reserved sios sioinh siom1 siom0 sck2 sck1 sck0 w w 0 0 0 0 0 0 0 setting of the divide value ?n? 000: 4 011: 7 001: 5 100: 8 010: 6 101: 9 sbi0cr1 serial bus interface 0 control register 1 1240h (sio mode) (prohibit rmw) transfer 0: stop 1: start transfer 0:continue 1:abort transfer mode 00: 8-bit transmit 01: reserved 10: 8-bit transmit/receive 11: 8-bit receive 110: 10 111: external clock sck0 db7 db6 db5 db4 db3 db2 db1 db0 r (receiving)/w (transmission) sbi0dbr sbi buffer register 1241h (prohibit rmw) undefined sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c0ar i 2 cbus 0 address register 1242h (prohibit rmw) setting slave address address recognition 0:enable 1:disable mst trx bb pin al/ sbim1 aas/ sbim0 ad0/ swrst1 lrb/ swrst0 r/w 0 0 0 1 0 0 0 0 sbi0sr when read serial bus interface 0 status register bus status monitor 0:free 1:busy arbitration lost detection monitor 1:detect slave address match detection monitor 1:detect general call detection 1:detect last receive bit monitor 0: ?0? 1: ?1? sbi0cr2 when write serial bus interface 0 control register 2 1243h (i 2 c bus mode) (prohibit rmw) 0:slave 1:master 0:receive 1:transmit start/stop condition generation 0:stop 1:start intsbe0 interrupt 0:request 1:cancel operation mode selection 00: port mode 10: i 2 c mode 01: sio mode 11: reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. siof/ sbim1 sef/ sbim0 ? ? r/w w 0 0 0 0 sbi0sr when read serial bus interface 0 status register transfer status 0:stopped 1:in progress shift status 0:stopped 1:in progress sbi0cr2 when write serial bus interface 0 control register 2 1243h (sio mode) (prohibit rmw) operation mode selection 00: port mode 10: i 2 c mode 01: sio mode 11: reserved always write ?0?. always write ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-368 i 2 c bus/serial channel (2/4) symbol name address 7 6 5 4 3 2 1 0 ? i2sbi0 w r/w 0 0 sbi0br0 serial bus interface 0 baud rate register 0 1244h (prohibit rmw) always write ?0?. idle2 0: stop 1: run p4en ? w 0 0 sbi0br1 serial bus interface 0 baud rate register 1 1245h (prohibit rmw) internal clock 0: stop 1: run always write ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-369 i 2 c bus/serial channel (3/4) symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon w r/w w r/w 0 0 0 0 0 0 0/1 number of transferred bits setting of the divide value ?n? 001: 6 100: 9 010: 7 101: 10 1248h (i 2 c bus mode) (prohibit rmw) 000: 8 011: 3 110: 6 001: 1 100: 4 111: 7 010: 2 101: 5 acknowledge mode 0: disable 1: enable 000: 5 011: 8 110: 11 111: reserved sios sioinh siom1 siom0 sck2 sck1 sck0 w w 0 0 0 0 0 0 0 setting of the divide value ?n? 000: 4 011: 7 001: 5 100: 8 010: 6 101: 9 sbi1cr1 serial bus interface 1 control register 1 1248h (sio mode) (prohibit rmw) transfer 0: stop 1: start transfer 0:continue 1:abort transfer mode 00: 8-bit transmit 01: reserved 10: 8-bit transmit/receive 11: 8-bit receive 110: 10 111: external clock sck1 db7 db6 db5 db4 db3 db2 db1 db0 r (receiving)/w (transmission) sbi1dbr sbi 1 buffer register 1249h (prohibit rmw) undefined sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c1ar i 2 cbus 1 address register 124ah (prohibit rmw) setting slave address address recognition 0:enable 1:disable mst trx bb pin al/ sbim1 aas/ sbim0 ad0/ swrst1 lrb/ swrst0 r/w 0 0 0 1 0 0 0 0 sbi1sr when read serial bus interface 1 status register bus status monitor 0:free 1:busy arbitration lost detection monitor 1:detect slave address match detection monitor 1:detect general call detection 1:detect last receive bit monitor 0: ?0? 1: ?1? sbi1cr2 when write serial bus interface 1 control register 2 124bh (i 2 c bus mode) (prohibit rmw) 0:slave 1:master 0:receive 1:transmit start/stop condition generation 0: stop 1: start intsbe1 interrupt 0:request 1:cancel operation mode selection 00: port mode 10: i 2 c mode 01: sio mode 11: reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. siof/ sbim1 sef/ sbim0 ? ? r/w w 0 0 0 0 sbi1sr when read serial bus interface 1 status register transfer status 0:stopped 1:in progress shift status 0:stopped 1:in progress sbi1cr2 when write serial bus interface 1 control register 2 124bh (sio mode) (prohibit rmw) operation mode selection 00: port mode 10: i 2 c mode 01: sio mode 11: reserved always write ?0?. always write ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-370 i 2 c bus/serial channel (4/4) symbol name address 7 6 5 4 3 2 1 0 ? i2sbi1 w r/w 0 0 sbi1br0 serial bus interface 1 baud rate register 0 124ch (prohibit rmw) always write ?0?. idle2 0: stop 1: run p4en ? w 0 0 sbi1br1 serial bus interface 1 baud rate register 1 124dh (prohibit rmw) internal clock 0: stop 1: run always write ?0?.
tmp92cy23/cd23a 2009-08-28 92cy23-371 (11) ad converter (1/3) symbol name address 7 6 5 4 3 2 1 0 eocf adbf ? ? itm0 repeat scan ads r r/w 0 0 0 0 0 0 0 0 admod0 ad mode control register 0 12b8h ad conversion end flag 0: conversion in progress 1: conversion complete ad conversion busy flag 0: conversion stopped 1: conversion in progress always write ?0?. always write ?0?. interrupt specification in conversion channel fixed repeat mode 0: every conversion 1: every fourth conversion repeat mode specification 0: single conversion 1: repeat conversion mode scan mode specification 0: conversion channel fixed mode 1: conversion channel scan mode ad conversion start 0: don?t care 1: start conversion always ?0? when read vrefon i2ad ? ? adch3 adch2 adch1 adch0 r/w 0 0 0 0 0 0 0 0 analog input channel selection 0000: an0 an0 0001: an1 an0 an1 0010: an2 an0 an1 an2 0011: an3 an0 an1 an2 an3 0100: an4 an0 an1 an2 an3 an4 0101: an5 an0 an1 an2 an3 an4 an5 0110: an6 an0 an1 an2 an3 an4 an5 an6 0111: an7 an0 an1 an2 an3 an4 an5 an6 an7 1000: an8 an0 an1 an2 an3 an4 an5 an6 an7 an8 1001: an9 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 1010: an10 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 1011: an11 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11 admod1 ad mode control register 1 12b9h vref application control 0: off 1: on idle2 0: stop 1: operate always write ?0?. always write ?0?. 1100 to 1111: reserved ? ? ? ? ? ? ? adtrge r/w 0 0 0 0 0 0 0 0 admod2 ad mode control register 2 12bah always write ?0?. always write ?0?. always write ?0?. always write ?0?. always write ?0?. always write ?0?. always write ?0?. ad conversion trigger start control 0: disable 1: enable
tmp92cy23/cd23a 2009-08-28 92cy23-372 ad converter (2/3) symbol name address 7 6 5 4 3 2 1 0 adr01 adr00 adr0rf r r adreg0l ad result register 0 low 12a0h undefined 0 adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 r adreg0h ad result register 0 high 12a1h undefined adr11 adr10 adr1rf r r adreg1l ad result register 1 low 12a2h undefined 0 adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 r adreg1h ad result register 1 high 12a3h undefined adr21 adr20 adr2rf r r adreg2l ad result register 2 low 12a4h undefined 0 adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 r adreg2h ad result register 2 high 12a5h undefined adr31 adr30 adr3rf r r adreg3l ad result register 3 low 12a6h undefined 0 adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 r adreg3h ad result register 3 high 12a7h undefined adr41 adr40 adr4rf r r adreg4l ad result register 4 low 12a8h undefined 0 adr49 adr48 adr47 adr46 adr45 adr44 adr43 adr42 r adreg4h ad result register 4 high 12a9h undefined adr51 adr50 adr5rf r r adreg5l ad result register 5 low 12aah undefined 0 adr59 adr58 adr57 adr56 adr55 adr54 adr53 adr52 r adreg5h ad result register 5 high 12abh undefined adr61 adr60 adr6rf r r adreg6l ad result register 6 low 12ach undefined 0 adr69 adr68 adr67 adr66 adr65 adr64 adr63 adr62 r adreg6h ad result register 6 high 12adh undefined adr71 adr70 adr7rf r r adreg7l ad result register 7 low 12aeh undefined 0 adr79 adr78 adr77 adr76 adr75 adr74 adr73 adr72 r adreg7h ad result register 7 high 12afh undefined
tmp92cy23/cd23a 2009-08-28 92cy23-373 ad converter (3/3) symbol name address 7 6 5 4 3 2 1 0 adr81 adr80 adr8rf r r adreg8l ad result register 8 low 12b0h undefined 0 adr89 adr88 adr87 adr86 adr85 adr84 adr803 adr82 r adreg8h ad result register 8 high 12b1h undefined adr91 adr90 adr9rf r r adreg9l ad result register 9 low 12b2h undefined 0 adr99 adr98 adr97 adr96 adr95 adr94 adr93 adr92 r adreg9h ad result register 9 high 12b3h undefined adra1 adra0 adrarf r r adregal ad result register a low 12b4h undefined 0 adra9 adra8 adra7 adra6 adra5 adra4 adra3 adra2 r adregah ad result register a high 12b5h undefined adrb1 adrb0 adrbrf r r adregbl ad result register b low 12b6h undefined 0 adrb9 adrb8 adrb7 adrb6 adrb5 adrb4 adrb3 adrb2 r adregbh ad result register b high 12b7h undefined
tmp92cy23/cd23a 2009-08-28 92cy23-374 (12) watch dog timer symbol name address 7 6 5 4 3 2 1 0 wdte wdtp1 wdtp0 ? i2wdt rescr ? r/w r/w 1 0 0 0 0 0 0 wdmod wdt mode register 1300h wdt control 1: enable wdt detection time 00: 2 15 /f sys 01: 2 17 /f sys 10: 2 19 /f sys 11: 2 21 /f sys always write ?0?. idle2 0: stop 1: operate 1: internally connects wdt out to the reset pin always write ?0? ? w ? wdcr wdt control register 1301h (prohibit rmw) b1h: wdt disable code 4e: wdt clear code (13) special timer for clock symbol name address 7 6 5 4 3 2 1 0 ? rtcsel1 rtcsel0 rtcrun r/w r/w 0 0 0 0 rtccr rtc control register 1310h always write ?0? 00: 2 14 /f s 01: 2 13 /f s 10: 2 12 /f s 11: 2 11 /f s 0: stop & clear 1: run (14) key-on wake up symbol name address 7 6 5 4 3 2 1 0 ki7en ki6en ki5en ki4en ki3en ki2en ki1en ki0en w 0 0 0 0 0 0 0 0 kien key input enable setting register 13a0h (prohibit rmw) ki7input 0: disable 1: enable ki6input 0: disable 1: enable ki5input 0: disable 1: enable ki4input 0: disable 1: enable ki3input 0: disable 1: enable ki2input 0: disable 1: enable ki1input 0: disable 1: enable ki0input 0: disable 1: enable ki7edge ki6dge ki5edge ki4edge ki3edge ki2edge ki1edge ki0edge w 0 0 0 0 0 0 0 0 kicr key input control register 13a1h (prohibit rmw) ki7 edge 0: rising 1: falling ki6 edge 0: rising 1: falling ki5 edge 0: rising 1: falling ki4 edge 0: rising 1: falling ki3 edge 0: rising 1: falling ki2 edge 0: rising 1: falling ki1 edge 0: rising 1: falling ki0 edge 0: rising 1: falling
tmp92cy23/cd23a 2009-08-28 92cy23-375 (15) program patch function (1/4) symbol name address 7 6 5 4 3 2 1 0 romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp00 address compare register 00 1400h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp01 address compare register 01 1401h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp02 address compare register 02 1402h (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub0ll address substitution register 0ll 1404h (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub0lh address substitution register 0lh 1405h (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub0hl address substitution register 0hl 1406h (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub0hh address substitution register 0hh 1407h (prohibit rmw) patch code (upper 8 bits) romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp10 address compare register 10 1408h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp11 address compare register 11 1409h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp12 address compare register 12 140ah (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub1ll address substitution register 1ll 140ch (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub1lh address substitution register 1lh 140dh (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub1hl address substitution register 1hl 140eh (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub1hh address substitution register 1hh 140fh (prohibit rmw) patch code (upper 8 bits)
tmp92cy23/cd23a 2009-08-28 92cy23-376 program patch function (2/4) symbol name address 7 6 5 4 3 2 1 0 romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp20 address compare register 20 1410h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp21 address compare register 21 1411h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp22 address compare register 22 1412h (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub2ll address substitution register 2ll 1414h (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub2lh address substitution register 2lh 1415h (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub2hl address substitution register 2hl 1416h (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub2hh address substitution register 2hh 1417h (prohibit rmw) patch code (upper 8 bits) romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp30 address compare register 30 1418h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp31 address compare register 31 1419h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp32 address compare register 32 141ah (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub3ll address substitution register 3ll 141ch (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub3lh address substitution register 3lh 141dh (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub3hl address substitution register 3hl 141eh (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub3hh address substitution register 3hh 141fh (prohibit rmw) patch code (upper 8 bits)
tmp92cy23/cd23a 2009-08-28 92cy23-377 program patch function (3/4) symbol name address 7 6 5 4 3 2 1 0 romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp40 address compare register 40 1420h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp41 address compare register 41 1421h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp42 address compare register 42 1422h (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub4ll address substitution register 4ll 1424h (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub4lh address substitution register 4lh 1425h (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub4hl address substitution register 4hl 1426h (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub4hh address substitution register 4hh 1427h (prohibit rmw) patch code (upper 8 bits) romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp50 address compare register 50 1428h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp51 address compare register 51 1429h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp52 address compare register 52 142ah (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub5ll address substitution register 5ll 142ch (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub5lh address substitution register 5lh 142dh (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub5hl address substitution register 5hl 142eh (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub5hh address substitution register 5hh 142fh (prohibit rmw) patch code (upper 8 bits)
tmp92cy23/cd23a 2009-08-28 92cy23-378 program patch function (4/4) symbol name address 7 6 5 4 3 2 1 0 romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp60 address compare register 60 1430h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp61 address compare register 61 1431h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp62 address compare register 62 1432h (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub6ll address substitution register 6ll 1434h (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub6lh address substitution register 6lh 1435h (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub6hl address substitution register 6hl 1436h (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub6hh address substitution register 6hh 1437h (prohibit rmw) patch code (upper 8 bits) romc07 romc06 romc05 romc04 romc03 romc02 w 0 0 0 0 0 0 romcmp70 address compare register 70 1438h (prohibit rmw) target rom address (lower 6 bit) romc15 romc14 romc13 romc12 ro mc11 romc10 romc09 romc08 w 0 0 0 0 0 0 0 0 romcmp71 address compare register 71 1439h (prohibit rmw) target rom address (middle 8 bit) romc23 romc22 romc21 romc20 ro mc19 romc18 romc17 romc16 w 0 0 0 0 0 0 0 0 romcmp72 address compare register 72 143ah (prohibit rmw) target rom address (upper 8 bit) roms07 roms06 roms05 roms04 ro ms03 roms02 roms01 roms00 w 0 0 0 0 0 0 0 0 romsub7ll address substitution register 7ll 143ch (prohibit rmw) patch code (lower 8 bits) roms15 roms14 roms13 roms12 ro ms11 roms10 roms09 roms08 w 0 0 0 0 0 0 0 0 romsub7lh address substitution register 7lh 143dh (prohibit rmw) patch code (upper 8 bits) roms23 roms22 roms21 roms20 ro ms19 roms18 roms17 roms16 w 0 0 0 0 0 0 0 0 romsub7hl address substitution register 7hl 143eh (prohibit rmw) patch code (lower 8 bits) roms31 roms30 roms29 roms28 ro ms27 roms26 roms25 roms24 w 0 0 0 0 0 0 0 0 romsub7hh address substitution register 7hh 143fh (prohibit rmw) patch code (upper 8 bits)
tmp92cy23/cd23a 2009-08-28 92cy23-379 6. port section equivalent circuit diagram reading the circuit diagram basically, the gate symbols written are the same as those used for the standard cmos logic ic [74hcxx] series. the dedicated signal is described below. stop: this signal becomes active ?1? when the halt mode setting register is set to the stop mode and the cpu executes the halt instru ction. when the drive enable bit is set to ?1?, however, stop remains at ?0?. the input protection resistance ranges from several tens of ohms to several hundreds of ohms. p0 (d0 to d7), p1 (d8 to d15), p4 (a0 to a7), p5 (a8 to a15), p6 (a16 to a23) p70 ( rd ), p71 ( srwr ), p72 ( srllb ), p73 ( srlub ) v cc output data output enable stop input data i/o input enable p-ch n-ch v cc output data output enable stop input data i/o input enable p-ch n-ch v cc programmable pull-up
tmp92cy23/cd23a 2009-08-28 92cy23-380 p74 (int0), pc1 to pc3 (int1 to int3) p80 ( 0cs ,ta1out), p81 ( 1cs ,ta3out), p82 ( 2cs ) p83 ( 3cs , wait ,ta5out), pd0 (int4,tb0out) input data input input enable function input function enable v cc output p-ch n-ch output data stop v cc output data output enable stop input data i/o input enable p-ch n-ch function input function enable
tmp92cy23/cd23a 2009-08-28 92cy23-381 pc0 (ta0in) pd1 (int5, tb1in0), pd3 (int7, tb1out0, rxd2) pd2 (int6, tb1in1, txd2) pd3 (int7, tb1out0, rxd2) input data input input enable funtion input input data input input enable function input function enable v cc output data open-drain output enable stop input data i/o input enable p-ch n-ch function input function enable v cc output data output enable stop input data i/o input enable p-ch n-ch function input function enable
tmp92cy23/cd23a 2009-08-28 92cy23-382 pd4 (tb1out1,sclk2, 2cts ), pf1 (rxd0), pf2 (sclk0, 0cts ,clk), pf4 (rxd1, hssi), pf5 (sclk1, 1cts , hsclk), pn0 (sck0), pn3 (sck1) note: hssi and hsclk function are not built into tmp92cy23. pf0 (txd0), pf3 (txd1, hsso) note: hsso function is not built into tmp92cy23. pn1 (sda0,so0), pn2 (scl0, si0), pn4 (sda1, so1), pn5 (scl1, si1) v cc output data output enable stop input data i/o input enable p-ch n-ch v cc output data open-drain output enable stop input data i/o input enable p-ch n-ch v cc output data output enable stop input data i/o input enable p-ch n-ch
tmp92cy23/cd23a 2009-08-28 92cy23-383 pg (an0 to an7), pl (an8 to an11) reset x1, x2 p76 (xt1), p77 (xt2) reset input v cc wdtout reset enable schmitt clock high-frequency oscillation enable x2 n-ch x1 p-ch oscillato r p76 (xt1) p77 (xt2) input enable clock output data stop input data input enable low-frequency oscillation enable input data output data output enable output enable oscillator a nalog input channel select analog input input data input input enable p-ch n-ch
tmp92cy23/cd23a 2009-08-28 92cy23-384 nmi am0 to am1 input data v cc nmi input
tmp92cy23/cd23a 2009-08-28 92cy23-385 7. notes and restrictions (1) notation a. the notation for built-in/ i/o registers is as follows: register symbol (e.g., ta01run denotes bit ta0run of register ta01run). b. read-modify-write instructions an instruction in which the cpu reads data from memory and writes the data to the same memory location in one instruction. example 1: set 3, (ta01run ) ... set bit 3 of ta01run. example 2: inc 1, (100h) ... increment the data at 100h. ? examples of read-modify-write instructions on the tlcs-900: exchange instruction ex (mem), r arithmetic operations add (mem), r/# adc (mem), r/# sub (mem), r/# sbc (mem), r/# inc #3, (mem) dec #3, (mem) logic operations and (mem), r/# or (mem), r/# xor (mem), r/# bit manipulation operations stcf #3/a, (mem) res #3, (mem) set #3, (mem) chg #3, (mem) tset #3, (mem) rotate and shift operations rlc (mem) rrc (mem) rl (mem) rr (mem) sla (mem) sra (mem) sll (mem) srl (mem) rld (mem) rrd (mem) c. fc, fs, f fph , f sys and one state the clock frequency input on x1 and 2 is referred to as f osch . the clock selected by pllcr0 is referred to as fc. the clock selected by syscr1 is referred to as f fph . the clock frequency give by f fph divided by 2 is referred to as f sys . one cycle of f sys is referred to as one state.
tmp92cy23/cd23a 2009-08-28 92cy23-386 (2) points to note a. am0 and am1 pins these pins are connected to the v cc or the v ss pin. do not alter the level when the pin is active. b. reserved address areas the 16-byte area from fffff0h to ffffffh is reserved as internal area and cannot be used. when using toshiba?s flash programming service, prepare your rom data (hex file) by leaving these 16 bytes blank or setting them all to ?ff? and register it with our rom data entry system. moreover, when using an emulator, since it is used for control of an emulator, 64k bytes with arbitrary 16m byte area of use cannot be performed. c. halt mode (idle1) when the halt instruction is executed in idle1 mode (in which only the oscillator operates), the internal special timer for clock operate. when necessary, stop the circuit by setting rtccr to ?0?, before the halt instructions is executed. d. warm-up timer the warm-up timer operates when stop mode is released, even if the system is using an external oscillator. as a result, a time equi valent to the warm-up time elapses between input of the release request and output of the system clock. e. watchdog timer the watchdog timer starts operation immediat ely after a reset is released. disable the watchdog timer when is not to be used. f. ad converter the string resistor between the vrefh and vr efl pins can be cut by program so as to reduce power consumption. when stop mode is used, disable the resistor using the program before the halt instruction is executed. g. cpu (micro dma) only the ?ldc cr, r? and ?ldc r, cr? instructions can be used to access the control registers in the cpu (e.g., the transfer source address re gister (dmasn).). h. undefined sfr the value of an undefined bit in an sfr is undefined when read. i. pop sr instruction please execute the pop sr instruction during di condition. j. interrupt when you use interruption, be sure to se t ?1? as the bit 7 of a simc register.
tmp92cy23/cd23a 2009-08-28 92cy23-387 8. package dimensions package name: lqfp100-p-1414-0.50f unit: mm
tmp92cy23/cd23a 2009-08-28 92cy23-388 package name: qfp100-p-1420-0.65a unit: mm
tmp92cy23/cd23a 2009-08-28 92cy23-389 restrictions on product use ? toshiba corporation, and its subsidiaries and affiliates (collectively ?toshiba?), re serve the right to make changes to the in formation in this document, and related hardware, software and systems (collectively ?product?) without notice. ? this document and any information herein may not be reproduc ed without prior written permission from toshiba. even with toshiba?s written permission, reproduc tion is permissible only if reproducti on is without alteration/omission. ? though toshiba works continually to improve product?s quality and reliability, product can malfunction or fail. customers are responsible for complying with safety standards and for prov iding adequate designs and safeguards for their hardware, software and systems which minimize risk and avoid situations in which a ma lfunction or failure of product could cause loss of human life, b odily injury or damage to property, including data loss or corruption. before creating and producing des igns and using, customers mus t also refer to and comply with (a) the latest versions of all relev ant toshiba information, including without limitation, this docume nt, the specifications, the data sheets and applicat ion notes for product and the precautions and conditions set forth in the ?toshiba semiconductor reliability handbook? and (b) t he instructions for the application that product will be used with or for. custome rs are solely responsible for all aspects of t heir own product design or applications, incl uding but not limited to (a) determining th e appropriateness of the use of this product in such design or applications; (b) evaluating and det ermining the applicability of any information contained in this document, or in charts, diagrams, programs, algorithms, sample application circuits, or any other referenced documents; and (c) validating all operating parameters for such designs and applications. toshiba assumes no liability for customers? product design or applications. ? product is intended for use in general el ectronics applications (e.g., computers, personal equipment, office equipment, measur ing equipment, industrial robots and home electr onics appliances) or for specif ic applications as expre ssly stated in this document . product is neither intended nor warranted for use in equipment or systems that require extraordinarily high levels of quality and/or re liability and/or a malfunction or failure of which may cause loss of hum an life, bodily injury, serious property damage or serious public impact (?unintended use?). unintended use includes, without limitation, e quipment used in nuclear facilities, equipment used in the ae rospace industry, medical equipment, equipment used for automobiles, tr ains, ships and other transportation, traffic signaling equipmen t, equipment used to control combustions or ex plosions, safety devices, elevators and esca lators, devices related to electric powe r, and equipment used in finance-related fields. do not use product for unintended use unle ss specifically permitted in this document. ? do not disassemble, analyze, reverse-engineer, alter, modify, translate or copy product, whether in whole or in part. ? product shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable laws or regulations. ? the information contained herein is pres ented only as guidance for product use. no re sponsibility is assumed by toshiba for an y infringement of patents or any other intellectual property rights of third parties that may result from the use of product. no license to any intellectual property right is granted by this document, w hether express or implied, by estoppel or otherwise. ? a bsent a written signed agreement, except as provid ed in the relevant terms and conditions of sale for product , and to the maximum extent allowable by law, toshiba (1) assumes no liability whatsoever, including without limitation, indirect, co nsequential, special, or incidental damages or loss, including without limitation, loss of profit s, loss of opportunities, business interruption and loss of data, and (2) disclaims any and all express or implied warranties and conditions related to sale, use of product, or information, including warranties or conditions of merchantability, fitness for a particular purpose, accuracy of information, or noninfringement. ? do not use or otherwise make available product or related so ftware or technology for any military purposes, including without limitation, for the design, development, use, stockpiling or manufacturing of nuclear, chemical, or biological weapons or missile technolog y products (mass destruction weapons). product and related softwa re and technology may be controlled under the japanese foreign exchange and foreign trade law and the u.s. export administration regulations. export and re-export of product or related softw are or technology are strictly prohibited except in compliance with all applicable export laws and regulations. ? please contact your toshiba sales representative for details as to environmental matters such as the rohs compatibility of pro duct. please use product in compliance with all applicable laws and regula tions that regulate the inclusion or use of controlled subs tances, including without limitation, the eu rohs directive. toshiba assumes no liability for damages or losses occurring as a result o f noncompliance with applicable laws and regulations.
tmp92cy23/cd23a 2009-08-28 92cy23-390


▲Up To Search▲   

 
Price & Availability of TMP92CD23ADFG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X